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) Quote 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); Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.