The Little Guy Posted April 19, 2007 Share Posted April 19, 2007 I am reading in HTML, and I am trying to use preg_match to find the title tags, and print out what is between the two tags. Any Ideas how? Current code (Doesn't work): preg_match("~<title>\W|\w</title>~",$contents,$match) Link to comment https://forums.phpfreaks.com/topic/47683-solved-find-the-title-tags-in-a-file/ Share on other sites More sharing options...
fert Posted April 19, 2007 Share Posted April 19, 2007 preg_match("/<title>(.*)<\/title>/",$contents,$match); Link to comment https://forums.phpfreaks.com/topic/47683-solved-find-the-title-tags-in-a-file/#findComment-232849 Share on other sites More sharing options...
The Little Guy Posted April 19, 2007 Author Share Posted April 19, 2007 Thanks Link to comment https://forums.phpfreaks.com/topic/47683-solved-find-the-title-tags-in-a-file/#findComment-232851 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.