note 111724 deleted from function.curl-exec by aharvey

From: Date: Thu, 21 Mar 2013 18:35:37 +0000
Subject: note 111724 deleted from function.curl-exec by aharvey
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-194160@lists.php.net to get a copy of this message
Note Submitter: Anonymous ---- if you are doing a negative test against curl_exec and other variables and you need to use the returned result to save to file or display, you have to place the curl_exec test inside brackets, for example: <?php if( (!$result = curl_exec( $c )) || curl_error( $c) ){ trigger_error( curl_error( $c ) ); } # now you can use $result to write the returned contents to a file with for example fopen() ?> if you don't include the curl_exec in brackets it will only return a resource value. i don't know if this is normal behavior or a bug as it does not occur when it is a positive test.

« previous php.notes (#194160) next »