Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Option 1) file_get_contents( $filename)

file_get_contents() returns string read from the source file requested.

Code Block
$src = "src/new.json";
$tmp = file_get_contents( $src);
echo $tmp;

If you modify something and want to save that file, you can also use file_put_contents($filename, $src)

Option 2) readfile( $filename)

readfile() return the text stream and shows its content while reading.

...