Nuv Posted May 26, 2011 Share Posted May 26, 2011 While using Curl after the first preg_match_all, the second preg_match_all has nothing to search from. Which means $continue becomes empty. Why is it so ? My problem lies in this code or is there something else ? <?php $kh = curl_init ("http://www.xxx.com/xxx.php".$day[1][0].""); curl_setopt ($kh, CURLOPT_COOKIEFILE, 'cookie.txt'); curl_setopt ($kh, CURLOPT_RETURNTRANSFER, true); $continue = curl_exec ($kh); curl_close($kh); sleep(1); preg_match_all('~<a\s+href="xxx.php?(.*?)"\s+accesskey="C"\s+class=\'nav\'\s+>~', $continue, $village); $pattern = '/(?:\?|&)c=([^"&]++)/'; preg_match_all($pattern, $continue, $walk); ?> Link to comment https://forums.phpfreaks.com/topic/237580-2nd-preg_match_all-doesnt-have-any-data-to-search-from-curl-used/ Share on other sites More sharing options...
.josh Posted May 26, 2011 Share Posted May 26, 2011 First off, preg_match_all() does not alter the subject in any way, so $continue is not "becoming empty" as you put it. 2nd, we cannot even begin to help without knowing what the value of $continue is, and what you are expecting to get out of it. Link to comment https://forums.phpfreaks.com/topic/237580-2nd-preg_match_all-doesnt-have-any-data-to-search-from-curl-used/#findComment-1220882 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.