Michdd Posted July 30, 2009 Share Posted July 30, 2009 How can I optimize this? There might be some white space between the <span> opening and closing tags and the <a> tag(s). preg_match_all('/\<span class="cclass"\>(.+?)\<\/span\>/s', file_get_contents('http://twitter.com/' . $user), $matches); for($i = 0;$i < count($matches[1]);$i++) { preg_match('/\<a href="(.+?)"/', trim($matches[1][$i]), $found[$i]); $results[] = substr($found[$i][1], 1); } return $results; Quote Link to comment https://forums.phpfreaks.com/topic/168098-solved-optimization/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.