سلام دوستان .
تابعی که از فایل randomselector اورده شده یک ایتم رو رندوم انتخاب میکنه
متغیر $image هم مورد تست قرار دادم وضعیتش اینه
./img/ok.jpeg
کد هم اینه
<?php
require __DIR__ . '/snipeduse/randomselector.php';
$path = './img/';
$files = array_slice(scandir($path), 2);
$name = rand_item_array($files);
$image = $path . $name ;
// open the file in a binary mode
$fp = fopen($image, 'rb');
// send the right headers
header("Content-Type: image/png");
header("Content-Length: " . filesize($image));
// dump the picture and stop the script
fpassthru($fp);
exit;
?>
اینم ارور تو مرورگر
cannot be displayed because it contains errors.اولین نفری باشید که به این پرسش کمک میکند و مسیر حل مشکل را باز میکند.
اولین پاسخ را بنویسیدشاید پاسخ شما همینجا باشد