The code you entered will not read image data, but rather its file name. If you need to get an image in the same directory, you can get its contents with the help of file_get_contents()which you can use to directly output it to the browser:
$im = file_get_contents("./image.jpeg");
header("Content-type: image/jpeg");
echo $im;
Otherwise, you can use the GD library to read image data for further image processing:
$im = imagecreatefromjpeg("./image.jpeg");
if ($im) {
header("Content-type: image/jpeg");
imagejpeg($im);
}
, , (, , , ), glob() jpegs, :
$jpegs = glob("./*.jpg");
foreach ($jpegs as $jpg) {
echo $jpg;
}