note 99082 modified in function.curl-setopt by danbrown

From: Date: Tue, 27 Jul 2010 01:27:49 +0000
Subject: note 99082 modified in function.curl-setopt by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-171153@lists.php.net to get a copy of this message
It appears that setting CURLOPT_FILE before setting CURLOPT_RETURNTRANSFER doesn't work, presumably because CURLOPT_FILE depends on CURLOPT_RETURNTRANSFER being set. So do this: <?php curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FILE, $fp); ?> not this: <?php curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); ?> --was-- It appears that setting CURLOPT_FILE before setting CURLOPT_RETURNTRANSFER doesn't work, presumably because CURLOPT_FILE depends on CURLOPT_RETURNTRANSFER being set. So do this: curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FILE, $fp); not this: curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); http://php.net/manual/en/function.curl-setopt.php

« previous php.notes (#171153) next »