<?
function img_check($image, $border = 0, $height = 200,$width = 200, $noImage = "http://www.jhalpe.com/images/misc/no-image-found.gif")
{
$fp = @fopen($image, "r"); // @ zorgt ervoor dat hij geen error weergeeft zoals: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in
if ($fp)
{
echo "<img src=\"".$image."\" border=\"".$border."\" width=\"".$width."\" height=\"".$height."\">";
}
else
{
echo "<img src=\"".$noImage."\" border=\"".$border."\">";
}
}
// Voorbeeld
img_check("http://www.sitemasters.be/images/header1.jpg", 1, 200, 200);
?>
<?
function img_check($image, $border = 0, $height = 200,$width = 200, $noImage = "http://www.jhalpe.com/images/misc/no-image-found.gif")
{
$fp = @fopen($image, "r"); // @ zorgt ervoor dat hij geen error weergeeft zoals: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in if ($fp)
{
echo "<img src=\"".$image."\" border=\"".$border."\" width=\"".$width."\" height=\"".$height."\">"; }
else
{
echo "<img src=\"".$noImage."\" border=\"".$border."\">"; }
}
// Voorbeeld
img_check("http://www.sitemasters.be/images/header1.jpg", 1, 200, 200);
?>