jjacquay712 Posted October 23, 2008 Share Posted October 23, 2008 I am trying to make a php spider that uses file_get_contents() to read a pages source, to search for a meta tag, and insert the data inside a database so my search script can search it. I cant seem to think of any meathod to do this... any ideas? Link to comment https://forums.phpfreaks.com/topic/129853-solved-php-spider-problems/ Share on other sites More sharing options...
jjacquay712 Posted October 23, 2008 Author Share Posted October 23, 2008 im looking for a function that would extract the text in between two keywords. example: get_text("<meta", "/>"); Link to comment https://forums.phpfreaks.com/topic/129853-solved-php-spider-problems/#findComment-673193 Share on other sites More sharing options...
discomatt Posted October 23, 2008 Share Posted October 23, 2008 Regex would work. preg_match_all('/<meta([^>]++)>/i', $html, $matches, PREG_PATTERN_ORDER); print_r($matches[1]); Link to comment https://forums.phpfreaks.com/topic/129853-solved-php-spider-problems/#findComment-673214 Share on other sites More sharing options...
teng84 Posted October 23, 2008 Share Posted October 23, 2008 use get_meta_tags() Link to comment https://forums.phpfreaks.com/topic/129853-solved-php-spider-problems/#findComment-673258 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.