I need a script that will be able to add a snippet of code to the top of 150 or so php files(/home/*/public_html/index.inc.php) for multiple users as I do not want to have to go in via ftp and do this manually. I can pay $5 as I think this would be something simple to make.
<?php // array of usernames, or however you want to populate the list $users = array('user1', 'user2', ...); // Code, use \n to add a line break $code = "<?php\n// your code\n\?>\n"; foreach ($users as $user) { $fp = fopen("/home/$user/public_html/index.inc.php", 'r+'); fwrite($fp, $code); fclose($fp); } ?> PHP: