How can I replace multiple PHP files in different directories with the same PHP file using PHP for example, How do I replace all the index.php files in Example 1 with the index.php file in Example 2
Example 1 url values
/files/user-2/a/index.php
/files/user-12/a/index.php
/files/user-23/a/index.php
/files/user-232/a/index.php
/files/user-2232/a/index.php
Example 2 url values
/files/user-2/a/index.php
/files/user-12/a/index.php
/files/user-23/a/index.php
/files/user-232/a/index.php
/files/user-2232/a/index.php
You should use the rename function ( http://php.net/manual/en/function.rename.php )
To use it, begin by parsing the dir content :
Good Luck !