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
Post a Comment