How to safely write JSON data to file using PHP How to safely write JSON data to file using PHP json json