3v4l.org

run code in 300+ PHP versions simultaneously
<?php $uploads_folder = "/home/yourUnixUsername/public_html/uploads/"; $web_folder = "/uploads/"; $image_requested = $_GET['pic']; // filename from url $images = array(); if(file_exists($uploads_folder.$image_requested)) // if that image exists, get every image from that folder { if ($dh = opendir($uploads_folder)) { $inc = 0; while (($file = readdir($dh)) !== false) { if (!is_dir($uploads_folder.$file)) { $images[$inc]=$web_folder.$file; // construct a web path to image $inc++; } } closedir($dh); } } foreach($images as $an_image) { echo '<img src="'.$an_image.'">'; } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key "pic" in /in/MmAfD on line 6 Warning: file_exists(): open_basedir restriction in effect. File(/home/yourUnixUsername/public_html/uploads/) is not within the allowed path(s): (/tmp:/in:/etc) in /in/MmAfD on line 10

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
65.77 ms | 401 KiB | 8 Q