Cut text from a string
| From: | Don Don | Date: | Thu, 02 Aug 2007 14:43:56 +0000 |
| Subject: | Cut text from a string | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-260052@lists.php.net to get a copy of this message | ||
hi all, am trying to cut some texts from a serries of string values e.g.
"this is how we do (50 cents feat. the game)"
"give it to me (nelly feat timerland)"
"let me hold you (bow wow feat omarion)"
i want to cut off the text between the comas and i've seen some examples
<?
$string = "Hello world, <b>this is a test</b>";
preg_match('/<b>.*<\/b>/i', $string, $result);
echo strip_tags($result[0]);
?>
<?
$string = "Hello world, <b>this is a test</b>";
list($junk, $good) = split('<b>', $string);
list($good, $junk) = split('</b>', $good);
echo $good;
?>
but they wont work with comas
---------------------------------
Yahoo! oneSearch: Finally, mobile search that gives answers, not web links.