Right now my code is below.Which I believe sends two request to Image url
if(getimagesize($imgurl)) // request 1
{
$imgget = file_get_contents("$imgurl"); // request 1
//other operations done here..
}
how can I check if its valid image and If its valid image get its contents in single request.
i.e., something like below
if($imgget = getimagesize($imgurl)) // request 1
{
//$imgget must have image contents
}