Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. $file = $_SERVER['DOCUMENT_ROOT'].'/'.$domaindir.'/test.php';
  2.  
  3. $dbfile = "include('".$_SERVER['DOCUMENT_ROOT']."/".$domaindir."/web_".$dbname.".inc.php');";
  4.  
  5. $file = file('yourfile.php');
  6.  
  7. $first_line = array_shift($file); // Remove first line and save it
  8. array_unshift($file, $yourSecondLine); // push second line
  9. array_unshift($file, $first_line); // Save back the first line
  10.  
  11. $fp = fopen('yourfile.php', 'w'); // Reopen the file
  12. fwrite($fp, implode("n", $file));
  13. fclose($fp);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement