Context ;
• from file_get_contents from url, i get lots of stuff like <item></item>
, <url></url>
, etc.
• i'm using preg_match_all to extract url, title, etc.
example:
$jStringToSubStract = '<a>stuffA</a><b>stuffB</b><url>http...</url>';
preg_match_all("#<url>(.*?)<\/url>#sx", $jStringToSubStract , $subItems, PREG_SET_ORDER);
foreach ( $subItems as $subItem ) {
if ( strlen ($subItem[1]) > 0 ) {
echo $subItem[1]; // this is returning the http... INSIDE <url></url>
}
}
but it's slow for a large amount...
Is there a faster alternative to preg_match_all to extract portion of strings ?