You are here:

Perl/PHP

Recent Answers

2017-03-22 PHP5 - PHP Script Followup:

If there are many folders, you might try adding an inner loop to go into each subdirectory, something like this:  if (file_exists($folderName)) {    foreach (new DirectoryIterator($folderName) as $fileInfo)

2017-03-22 PHP5 - PHP Script Followup:

Hi Nathan,  My first guess would be a permission issue, but you can change this:  unlink(...)  to this:  $deleted = unlink(...)  if ($deleted) echo "file was deleted";  else echo "file was not deleted"

2017-03-08 PHP5 - PHP Script Question:

Hi Nathan,  It looks to me like this code (saved in a file like deleteAfter2Weeks.php) would do the trick:  <?php  $folderName = "/cameras";  if (file_exists($folderName)) {      foreach (new DirectoryIterator($folderName)

Categories

Browse Alphabetically

©2017 About.com. All rights reserved.