Write JSON to file in PHP

$json = '{"key":"value"}';
$file = new File('/path/to/file', true);
$file->write($json);

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.