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. Link to comment https://forums.phpfreaks.com/topic/142919-how-to-extract-data-from-html-code/ 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. Link to comment https://forums.phpfreaks.com/topic/142919-how-to-extract-data-from-html-code/#findComment-749379 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. Link to comment https://forums.phpfreaks.com/topic/142919-how-to-extract-data-from-html-code/#findComment-749623 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.