This works for me:
$url = "http://static.bbci.co.uk/frameworks/barlesque/2.51.4/orb/4/img/bbc-blocks-dark.png";
$imagedata = file_get_contents($url);
//echo strlen($imagedata); // outputs 1020
if(strlen($imagedata) == 1020 ) {
echo "length is 1020";
}
And as further troubleshooting, I would try a var_dump(get_defined_vars());
at the end of your code and inside the if statement to see whats going on.
//Edit/Update: Using your url, and also putting in a var dump twice:
$url = "http://s22.postimg.org/3k3o9ly8t/testigo.jpg";
$imagedata = file_get_contents($url);
$strlen = strlen($imagedata); // outputs 4669
var_dump($strlen);
if($strlen == 4669 ) {
echo "length is 4669 \n";
var_dump($strlen);
}
returns:
PhpMate running PHP 5.3.15 with (/usr/bin/php)
>>> untitled
int(4669)
length is 4669
int(4669)