Changing a file in place : file_put_contents « File Directory « PHP






Changing a file in place

 
<?php
$contents = file_get_contents('pickles.txt');
$contents = strtoupper($contents);
file_put_contents('pickles.txt', $contents);
?>
  
  








Related examples in the same category

1.Checking for an error from file_put_contents()
2.Saving a file with file_put_contents()