Last active
July 18, 2021 20:32
-
-
Save ederrafo/71594f2588a42dc7620a9ab147a1a2a0 to your computer and use it in GitHub Desktop.
php read json file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$string = trim(file_get_contents(dirname(__FILE__) . "/response.json")); | |
// Remove utf8 sequence | |
$bom = pack('H*','EFBBBF'); | |
$string = preg_replace("/^$bom/", '', $string); | |
$data = json_decode($string); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment