What does $returnCode actually contain?
$returnCode = (int)curl_getinfo($ch, CURLINFO_HTTP_CODE);
switch($returnCode){
case 404:
$result = 'ERROR -> 404 Not Found';
break;
default:
break;
}
I would suggest replacing the above with the below if it just has a number.
$returnCode = (int)curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($returnCode==404 || $returnCode=='404'){
$result = 'ERROR -> 404 Not Found';
}