Good afternoon, there is such a script:

<?php $dir = '../'; $f = scandir($dir); foreach ($f as $file){ if(preg_match('/\.(php)/', $file)){ echo $file.'<br/>'; } } ?> 

as it shows it surfs and displays all php files in a directory, tell me how to make it so that these files are displayed in the checkbox?

  <p>VIBIRITE STRANICI DLYA DELETe</p> <p><input type="checkbox" name="a" value="НА"> НА </p> <p><input type="checkbox" name="a" value="Каждый"> Каждый</p> <p><input type="checkbox" name="a" value="Файл"> Файл</p> <p><input type="checkbox" name="a" value="Свой"> Свой </p> <p><input type="checkbox" name="a" value="Инпут"> Инпут</p> 

those. for example, in the folder of 6 files, the script displays them without any problems in the loop, but how can I do this so that I can output them not using echo to the posts via br , but each file to my input box of the checkbox. The bottom line is that the files in the directory look which I want to do through the checkbox, so that you can mark and delete the necessary files

  • echo '<input type = checkbox value ='. $ file. '>'. $ file; not? - Jean-Claude
  • it certainly is. but, file names are more than one and you need your own checkbox for each one and - qaz qaz
  • Well, put it in a loop and there will be as many checkboxes as there are files. - Maxim Drobyshev
  • lol odd i fucked. thanks - qaz qaz

0