Finding image url is valid or not in PHP

Thursday, June 17, 2010 4:01
Posted in category PHP

Here is the very useful function to find image url is valid or not in PHP

  	function is_valid_image_url($image_url)
  	{
  		$size = getimagesize($image_url);
  		if(!is_array($size))
  		{
  			return false;
  		}

  		return true;
  	}

The above function will return true, if the image url is valid otherwise false.

You can skip to the end and leave a response. Pinging is currently not allowed.

Leave a Reply

*