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); ?> Quote Link to comment 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. 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.