Share & grow the world's code base!

Delve into a community where programmers unite to discover code snippets, exchange skills, and enhance their programming proficiency. With abundant resources and a supportive community, you'll find everything essential for your growth and success.

1 snippets
  • Removing all files from a folder using PHP

    $folderPath = "/tmp/test-folder"; 
    // List of files inside the folder 
    $files = glob($folderPath.'/*'); 
    foreach($files as $file) { 
    		// Delete the given file 
    echo "Files deleted";
    // php main.php
    // Files deleted

    PHP program to delete all files from a specified folder.