I need to replace a space delimited string in a db query with apostrophy comma apostrophy.

I have this but it pukes.

PHP Code:
preg_replace('/ /'''''$myvar['keywords']) 
Basically its ....

item1 item2 item3

And should be ...

item1', 'item2', 'item3

as I can easily wrap the external apostrophies around the result to make...

'item1', 'item2', 'item3'


What escape sequence do I need if any?

Thanks