kaneos Posted October 23, 2011 Share Posted October 23, 2011 I have a string $str that contains a web page information. it has multiple title tags [title][/title] within it. How do I get the contents within all these title tags thanks Link to comment https://forums.phpfreaks.com/topic/249665-getting-string-between-two-tags/ Share on other sites More sharing options...
WebStyles Posted October 24, 2011 Share Posted October 24, 2011 Try something like this: preg_match_all('/\<title\>(.*?)\<\/code\>/is', $str, $matches); echo '<pre>'; print_r($matches); echo '</pre>'; Link to comment https://forums.phpfreaks.com/topic/249665-getting-string-between-two-tags/#findComment-1281731 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.