<?
$filestr="test.jpg";
if(file_exists($filestr))
{
?>
  /*图片存在,显示实际图片*/
<?
}
else
{
?>
  /*图片不存在,显示默认图片*/
<?
}
?>