razar2 Posted December 12, 2011 Share Posted December 12, 2011 Hello, I need help with regex cause i never used it before. So i need to extract text for example from this string : Code: [select] <li>Some kinda <b>text</b></li> <li>With lot of <i>html</i> tags in it</li> And i need to get that data from <li> to </li> in array using php Please help Thanks before p.s. sorry for my english Link to comment https://forums.phpfreaks.com/topic/253018-regex-thing/ Share on other sites More sharing options...
Winstons Posted December 12, 2011 Share Posted December 12, 2011 Do you mean this ? $str = '<li>Some kinda <b>text</b></li> <li>With lot of <i>html</i> tags in it</li> '; preg_match_all("#<li>(.*)</li>#isU", $str, $match); echo '<pre>'.print_r($match[1], 1).'</pre>'; Link to comment https://forums.phpfreaks.com/topic/253018-regex-thing/#findComment-1297196 Share on other sites More sharing options...
razar2 Posted December 12, 2011 Author Share Posted December 12, 2011 I hope So Link to comment https://forums.phpfreaks.com/topic/253018-regex-thing/#findComment-1297199 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.