In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is about how to solve the problem of json_decode null in php7. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Specific problem description:
1. Confirm that the file does not have a BOM header
2. Try the following ways to remove illegal strings, but still output NULL
$some_string = htmlspecialchars_decode ($some_string); $some_string = preg_replace ("/\ t /", "", $some_string); $some_string = preg_replace ("/\ n /",'', $some_string); $some_string = str_replace ("\ n",'', $some_string); $some_string = str_replace ('\ n', $some_string)
3. Json_last_error () output 4 Syntax error, malformed JSON
4. Output the string directly, and the browser can parse the josn normally, as shown in the following screenshot
Solution:
Because your string is not a standard JSON string, the standard JSON string uses "cause" for every string type.
Test code
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.