3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if(isset($_POST['log'])){ $nm = $_POST['nm']; $ds = $_POST['dl']; foreach($_FILES ['files']["tmp_name"] as $key => $name_tmp){ $name = $_FILES['files']['name'] [$key]; $tmpnm = $_FILES['files']['tmp_name'] [$key]; $type = $_FILES['files']['type'][$key]; $size = $_FILES['files']['size'][$key]; $dir = "filedata".$name; $move = move_uploaded_file($tmpnmn,$dir); if ($move){ echo "<script>alert('terima kasih')</script>"; } else { echo "<script>alert('gagal upload')</script>"; } } } ?> <form action="" method="post" enctype="multipart/form-data"> <p> <label>File</label> <input type="file" name="file[]" multiple/> </p> <p> <label>Name</label> <input type="text" name="nm"/> </p> <p> <textarea rows="10" cols="25" name="dl"></textarea> </p> <p> <input type="submit" name="log" value="upload"/> </p> </form>
based on BjR5i
Output for 4.3.0 - 7.2.0
<form action="" method="post" enctype="multipart/form-data"> <p> <label>File</label> <input type="file" name="file[]" multiple/> </p> <p> <label>Name</label> <input type="text" name="nm"/> </p> <p> <textarea rows="10" cols="25" name="dl"></textarea> </p> <p> <input type="submit" name="log" value="upload"/> </p> </form>