arrays - Adding double quotes with white spaces words in php -


i have string in below format.

banking sector , lorem ispum dummy text , partner or agri business not corporate finance 

i need convert query below format using php.

"banking sector" , "lorem ispum dummy text" , "partner" or "agri business" not "corporate finance" 

i need add double quotes words in between and/or/not operators. how can that?

if string don't start , don't terminate (and/or/not) can use this:

$output = str_replace(array(" , "," or "," not "),array('" , "','" or "','" not "'),$input); $output ='"'.trim($output).'"'; 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -