当前位置:网站首页>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);
边栏推荐
- leetcode刷题:二叉树16(路径总和)
- [OBS] qstring's UTF-8 Chinese conversion to blog printing UTF-8 char*
- Build your own website (16)
- [C language] string function and Simulation Implementation strlen & strcpy & strcat & StrCmp
- Webuploader file upload drag upload progress monitoring type control upload result monitoring control
- 1:引文;
- Four methods of random number generation | random | math | threadlocalrandom | securityrandom
- 多分支结构
- 常用运算符与运算符优先级
- ICTCLAS用的字Lucene4.9捆绑
猜你喜欢
leetcode刷题:二叉树11(平衡二叉树)
618 "low key" curtain call, how can baiqiushangmei join hands with the brand to cross the "uncertain era"?
Leetcode: binary tree 15 (find the value in the lower left corner of the tree)
How about testing outsourcing companies?
Interviewer: what is the internal implementation of set data types in redis?
力扣 1200. 最小绝对差
Zhongang Mining: analysis of the current market supply situation of the global fluorite industry in 2022
Bitcoinwin (BCW) was invited to attend Hanoi traders fair 2022
.Net分布式事务及落地解决方案
淺淺的談一下ThreadLocalInsecureRandom
随机推荐
Analysis of openh264 decoded data flow
C - sequential structure
DP:树DP
ICTCLAS word Lucene 4.9 binding
Four methods of random number generation | random | math | threadlocalrandom | securityrandom
What are general items
leetcode刷题:二叉树14(左叶子之和)
Where is the operation of new bonds? Is it safer and more reliable to open an account
40000 word Wenshuo operator new & operator delete
leetcode刷题:二叉树12(二叉树的所有路径)
建立自己的网站(16)
Build your own website (16)
618 "low key" curtain call, how can baiqiushangmei join hands with the brand to cross the "uncertain era"?
[untitled]
Leetcode brush question: binary tree 14 (sum of left leaves)
Bitcoinwin (BCW) was invited to attend Hanoi traders fair 2022
Necessary skills for interview in large factories, 2022android will not die, I will not fall
零道云新UI设计中
Debezium series: modify the source code to support UNIX_ timestamp() as DEFAULT value
Gstreamer中的task