Versions Compared

Key

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

...

Option 1) readfile( $filename)

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

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

...

Unlike readfile(), it does not display anything on the screen after reading the source file.

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

...