function strip_cdata($string)
{
preg_match_all('/<!\[cdata\[(.*?)\]\]>/is', $string, $matches);
return str_replace($matches[0], $matches[1], $string);
}
I use the above function to extract text from cdata, but I don’t know how to modify the reg expression to get a number from the url below.
http://blah.somesite.com/anytextcouldbehere/2828842087.html
Specifically, I need to get “2828842087” from the above url. It will always be numbers and be between the last “/” and “.html”.
Thanks
No need to use regexp here: