ivytony Posted January 29, 2009 Share Posted January 29, 2009 For example, here's a paragraph of text in HTML code: <a href="http://www.metacafe.com/watch/23483/cute_girl/"><img src="http://s1.mcstatic.com/thumb/2348336/9545650/4/directors_cut/0/1/cute_smart_girl.jpg" align="right" border="0" alt="Cute Smart Girl" vspace="4" hspace="4" width="134" height="78" /></a> <p> laugh and leave comment <br>Ranked <strong>4.46</strong> / 5 | 4995 views | I would like to extract the image link, 'laugh and leave comment', and the numbers 4.46 and 4995 from the above paragraph. I wonder if it's possible to do this with PHP. Quote Link to comment Share on other sites More sharing options...
Mchl Posted January 29, 2009 Share Posted January 29, 2009 It is. Some prefer to do it with explode, others do it with regular expressions. Quote Link to comment Share on other sites More sharing options...
.josh Posted January 29, 2009 Share Posted January 29, 2009 A regex could be made to extract that data, but it may or may not work within the larger context of where that posted content is. Quote Link to comment 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.