当前位置:网站首页>A solution to PHP's inability to convert strings into JSON
A solution to PHP's inability to convert strings into JSON
2022-07-05 20:02:00 【Dehong demon king】
background : I've been working on applets recently ( For the customer ), A watermark applet , The watermark is removed through the interface , The principle is simple , But there are too many addresses and domain names to be resolved by the target , After using the domain name universal configuration, there is also an error that is not in the legal domain name , So you can only use your own server to perform a pedal , Therefore, after data callback, you need to clean the data and give it to the applet , There is a problem here :
$result=send_post('https://****.cn/video.php', $post_data);
// $info = json_decode(trim($result),true);
$info=json_encode($result);
echo gettype($info);
adopt json_decode、json_encode It can't be converted into json, The same is string type
terms of settlement :
Go empty trim()
Solve the code :
$result=send_post('https://*****/video.php', $post_data);
$info = json_decode(trim($result),true);
echo gettype($info);
边栏推荐
- What is the function of okcc call center
- Leetcode: binary tree 15 (find the value in the lower left corner of the tree)
- How to select the Block Editor? Impression notes verse, notation, flowus
- Cocos2d-x项目总结中的一些遇到的问题
- Debezium series: modify the source code to support drop foreign key if exists FK
- [C language] string function and Simulation Implementation strlen & strcpy & strcat & StrCmp
- 安信证券在网上开户安全吗?
- What is the core value of testing?
- Four methods of random number generation | random | math | threadlocalrandom | securityrandom
- c語言oj得pe,ACM入門之OJ~
猜你喜欢
Successful entry into Baidu, 35K monthly salary, 2022 Android development interview answer
618 "low key" curtain call, how can baiqiushangmei join hands with the brand to cross the "uncertain era"?
[OBS] qstring's UTF-8 Chinese conversion to blog printing UTF-8 char*
Leetcode: binary tree 15 (find the value in the lower left corner of the tree)
Win10 x64环境下基于VS2017和cmake-gui配置使用zxing以及opencv,并实现data metrix码的简单检测
[hard core dry goods] which company is better in data analysis? Choose pandas or SQL
After 95, Alibaba P7 published the payroll: it's really fragrant to make up this
Complete interview questions for interviewers and senior Android engineers in front-line Internet enterprises
Force buckle 1200 Minimum absolute difference
Zhongang Mining: analysis of the current market supply situation of the global fluorite industry in 2022
随机推荐
Force buckle 1200 Minimum absolute difference
[hard core dry goods] which company is better in data analysis? Choose pandas or SQL
-v parameter of GST launch
Cocos2d-x项目总结中的一些遇到的问题
40000 word Wenshuo operator new & operator delete
Debezium series: modify the source code to support drop foreign key if exists FK
Add data to excel small and medium-sized cases through poi
C - sequential structure
Build your own website (16)
Debezium series: modify the source code to support UNIX_ timestamp() as DEFAULT value
c语言oj得pe,ACM入门之OJ~
微信小程序正则表达式提取链接
成功入职百度月薪35K,2022Android开发面试解答
Bzoj 3747 poi2015 kinoman segment tree
Fundamentals of deep learning convolutional neural network (CNN)
Xaas trap: all things serve (possible) is not what it really needs
银河证券在网上开户安全吗?
Postman core function analysis - parameterization and test report
浅浅的谈一下ThreadLocalInsecureRandom
C langue OJ obtenir PE, ACM démarrer OJ