I am using file_get_content
to get some JSON string from an API. However sometimes the API returns a PHP notice along with the JSON string, which makes my `JSON_decode" broken. Is there anyway to ignore the notice and get the JSON string only?
Asked
Active
Viewed 20 times
0

shenkwen
- 3,536
- 5
- 45
- 85
-
https://stackoverflow.com/questions/272361/how-can-i-handle-the-warning-of-file-get-contents-function-in-php – Rakesh Hiray May 26 '20 at 03:26
-
Does this answer your question? [How can I handle the warning of file\_get\_contents() function in PHP?](https://stackoverflow.com/questions/272361/how-can-i-handle-the-warning-of-file-get-contents-function-in-php) – mickmackusa Sep 17 '20 at 23:03