String is stored in $variable. $variable looks like:
plusCardName: 'Plus Card', over the hills 'fire' city 'song'.
Need to output what is inside ''. Output would be:
Plus Card
fire
song
String is stored in $variable. $variable looks like:
plusCardName: 'Plus Card', over the hills 'fire' city 'song'.
Need to output what is inside ''. Output would be:
Plus Card
fire
song
Check this:
function get_delimited($str, $delimiter='"') {
$escapedDelimiter = preg_quote($delimiter, '/');
if (preg_match_all('/' . $escapedDelimiter . '(.*?)' . $escapedDelimiter . '/s', $str, $matches)) {
return $matches[1];
}
}
$words = get_delimited("'Plus Card', over the hills 'fire' city 'song'","'");
<?php
preg_match_all("/'([^']*)'/", $str, $m);
print_r($m);
?>
love u rizier123