Re: Weird Results from Curl

From: Date: Fri, 29 Feb 2008 21:32:27 +0000
Subject: Re: Weird Results from Curl
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-270778@lists.php.net to get a copy of this message
Wolf wrote:
I'm curling a site to process some data, all well and good but the results are baffling... $result = curl_exec($ch); curl_close($ch); echo "<HR>".gettype ($result); Of course that's not all the code, but the results contain: --------- 0 11 0 1 1 1 1 11 5 An Error Has Occurred During Processing. Error: An Error occured . A message has been sent to the System Administrator with the details of the problem you have encountered. 1 ---- What I can't seem to figure out is what the result type actually is and how to pull just the first piece (0,1,etc) out of the "0 11" that gets returned. I have tried to do a strlen conversion, that failed. I've tried bool converting but it doesn't come across right either. Any ideas? Thanks! Wolf
It sounds like the error message is being returned from the remote server. Is gettype() outputting the numbers, or is that part of the output from curl? gettype should be returning a string, so I wouldn't think that gettype would be returning the numbers. Are you using the CURLOPT_RETURNTRANSFER option? If so, then $result would have the text of the site on success, and false on error. -- Ray Hauge www.primateapplications.com

« previous php.general (#270778) next »