bapi Posted November 20, 2007 Share Posted November 20, 2007 hi, I want to create a script which could extract a paragraph (which are under <p> .......</p>) from text file. How can it be done Link to comment https://forums.phpfreaks.com/topic/78067-extracting-pragraph-from-file/ Share on other sites More sharing options...
MadTechie Posted November 20, 2007 Share Posted November 20, 2007 something like this <?php $fulltext = "blar <p>Hello world</p> blar"; $text = ""; if (preg_match('%<p>(.*?)</p>%si', $fulltext , $regs)) { $text= $regs[1]; } echo $text; ?> Link to comment https://forums.phpfreaks.com/topic/78067-extracting-pragraph-from-file/#findComment-395148 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.