Usa il CURLOPT_RETURNTRANSFER opzione. Altrimenti cURL eseguirà automaticamente l'eco dei dati e restituirà semplicemente true (che viene convertito in 1 dall'eco).
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
PHP.net dice,
Usa il CURLOPT_RETURNTRANSFER opzione. Altrimenti cURL eseguirà automaticamente l'eco dei dati e restituirà semplicemente true (che viene convertito in 1 dall'eco).
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
PHP.net dice,