You can directly return $output === false 

curl_exec returns false on failure: http://php.net/curl_exec