Copy php.ini to all main directories (but not sub folders)
Jan 1st, 2009 by admin
Lets say you want to copy php.ini to all the domain directors in hostgator (but NOT the subfolders). Here's something that you can do. Just create a file called php_modifed.php and do your settings there. And copy that file and this file to the base directory and run the PHP script.
<?php
function dirTree($dir) {
$file = "php_modified.php";
$d = dir($dir);
while (false !== ($entry = $d->read())) {
if($entry != '.' && $entry != '..' && is_dir($dir.$entry))
copy ($file, $entry . "/php.ini");
}
$d->close();
return $arDir;
}
function printTree($array, $level=0) {
foreach($array as $key => $value) {
echo "<div class='dir' style='width: ".($level*20)."px;'> </div>".$key."<br/>\n";
if(is_array($value))
printTree($value, $level+1);
}
}
$dir = "./";
dirTree($dir);
?>


US green card holder works Canada and earns tons of money. How do you report someone for not paying any taxes? Is he allowed to keep a green card and do this? Where's the right place to report this?