WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Recursive function to move files on a filesystem. It can be minor changed in order to copy recursively.
Categories : PHP, Filesystem, Algorithms Update Picture
Joao Rochate
Date : Jul 30th 1999
Grade : 5 of 5 (graded 1 times)
Viewed : 14389
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Joao Rochate
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?

/* ### Recursive move/copy function ###
Sometimes we need to move/copy a complete directory structure.
It is dangerous to trust on the OSes utilities, so I thought the best was to build my own function to such tasks.

Given a source dir. and a dest dir., the function finds all files and directories on source, and calls itself when it
finds another directory.

It is very simple to understand, and works very fast.
Have fun...

*/

function mover($src,$dst) {
$handle=opendir($src); // Opens source dir.
if (!is_dir($dst)) mkdir($dst,0755); // Make dest dir.
while ($file = readdir($handle)) {
if (($file!=".") and ($file!="..")) { // Skips . and .. dirs
$srcm=$src."/".$file;
$dstm=$dst."/".$file;
if (is_dir($srcm)) { // If another dir is found
mover($srcm,$dstm); // calls itself - recursive WTG
} else {
copy($srcm,$dstm);
unlink($srcm); // Is just a copy procedure is needed
} // comment out this line
}
}
closedir($handle);
rmdir($src); // and this one also :)
}

?>



These 2 functions write and read the contents of a specially designated multi-dimensional array to and from a text file.
Categories : Algorithms, PHP, Filesystem
Kasskooye($path) tell you the complete size of a folder
Categories : PHP, Algorithms, Utilities, Filesystem
Easy upload class
Categories : PHP Classes, Filesystem, HTTP, PHP
Timer - a class that uses microtime() to provide easy calculation of elapsed times
Categories : Algorithms, PHP, PHP Classes
A very simple and efficient split bar the B-Z bar , for mysql and php ... Tired of obfuscated code try this one ...
Categories : PHP, Databases, MySQL, Algorithms
Handle multiple file upload
Categories : Complete Programs, Filesystem, PHP, HTML and PHP
Directory viewer, customize how you display the file structure, easy to understand. Found out about PHP 3 days ago, and this is my first prog.
Categories : HTML and PHP, Complete Programs, Directories, Filesystem, PHP
basename -- Returns filename component of path
Categories : PHP, PHP Functions, Filesystem
How to judge if an integer is odd or is even in Php3?
Categories : Math., PHP, Algorithms
Simple pipe delimited file export program that downloads to a local machine
Categories : PHP, Filesystem, Databases, MySQL, HTTP
Single-file PHP news system with automatic folder structure creation
Categories : PHP, Filesystem, Arrays
A PHP Script that shows how to use FTP to run a shell script, read two local files and update data in a database.
Categories : PHP, Filesystem, FTP, Date Time, Databases
Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
Read DPI value from image with PHP
Categories : PHP, Graphics, Filesystem
Execute a command to a string
Categories : PHP, Program Execution, Filesystem