السلام عليكم
أخوانى انا ماعندى خبره بى PHP وحاب أغير لو الخلفيه إلى لون ثانى
هيه الحين باللون الأبيض
وأريد مثلان أحطه لون بنى على سبيل المثال
وهذا هوه الكود
كود PHP:
$images = array();
#Locate and all of the existing images
$directory = opendir($imagedir);
while($filename = readdir($directory)){
if(strlen($filename) > 2){ #ignore . and ..
$localext = substr($filename, -3);
if(!((strcasecmp($localext, "gif") == 0) || (strcasecmp($localext, "jpg") == 0) || (strcasecmp($localext, "bmp") == 0) || (strcasecmp($localext, "png") == 0)))
continue;
array_push($images, $filename);
}
}
#choose a random image from the array
srand((double)microtime() * 1000000);
$selection = $images[rand(0, sizeof($images)-1)];
#display the imaeg
echo "<img src=\"$imagedir$selection \" alt=\"$selection (" . filesize("$imagedir/$selection") . " bytes)\">";
?>
كيف أغير لون الخلفيه ؟