ZoCX Posted October 25, 2011 Share Posted October 25, 2011 hello there, i want to preg_match someting from curl "keywords" example <meta content='bla bla bla...' name='description' /> <meta content='bla bla bla...' name='keywords' /> how you can see all start disame with " <meta content=' " how i can make the preg_match to get the last " <meta content=' " and not the first one, i just need the preg_match command i try this command ... $patterns[3] = '/(?:.*)<meta content=\'(.*?)\' name=\'description\' \/>(?:.*)/i'; $replacements[3] = 'Desc=[$1]<br />'; Link to comment https://forums.phpfreaks.com/topic/249799-need-help-with-curl-and-preg_match/ Share on other sites More sharing options...
requinix Posted October 25, 2011 Share Posted October 25, 2011 get_meta_tags Link to comment https://forums.phpfreaks.com/topic/249799-need-help-with-curl-and-preg_match/#findComment-1282226 Share on other sites More sharing options...
ZoCX Posted October 25, 2011 Author Share Posted October 25, 2011 hello there, its good that but its not what i need, to i make like that its to many request and i have already to many, i get from website the title desc and keywords can someone tell me how i can make the preg_match for this ? Link to comment https://forums.phpfreaks.com/topic/249799-need-help-with-curl-and-preg_match/#findComment-1282232 Share on other sites More sharing options...
requinix Posted October 25, 2011 Share Posted October 25, 2011 What's your code now? Link to comment https://forums.phpfreaks.com/topic/249799-need-help-with-curl-and-preg_match/#findComment-1282243 Share on other sites More sharing options...
QuickOldCar Posted October 26, 2011 Share Posted October 26, 2011 preg_match("|<meta[^>]*description[^>]*content=\"([^>]+)\"[^>]*>|smUi",$html, $matches); Link to comment https://forums.phpfreaks.com/topic/249799-need-help-with-curl-and-preg_match/#findComment-1282368 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.