当前位置:网站首页>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);
边栏推荐
- 银河证券在网上开户安全吗?
- [C language] three implementations of quick sorting and optimization details
- What is the core value of testing?
- Flume series: interceptor filtering data
- Two pits exported using easyexcel template (map empty data columns are disordered and nested objects are not supported)
- Go language learning tutorial (16)
- 港股将迎“最牛十元店“,名创优品能借IPO突围?
- Go language | 03 array, pointer, slice usage
- Win10 x64环境下基于VS2017和cmake-gui配置使用zxing以及opencv,并实现data metrix码的简单检测
- Force buckle 1200 Minimum absolute difference
猜你喜欢
如何安全快速地从 Centos迁移到openEuler
Debezium series: record the messages parsed by debezium and the solutions after the MariaDB database deletes multiple temporary tables
Bitcoinwin (BCW) was invited to attend Hanoi traders fair 2022
Jvmrandom cannot set seeds | problem tracing | source code tracing
城链科技数字化创新战略峰会圆满召开
再忙不能忘安全
40000 word Wenshuo operator new & operator delete
Autumn byte interviewer asked you any questions? In fact, you have stepped on thunder
秋招字节面试官问你还有什么问题?其实你已经踩雷了
aggregate
随机推荐
建立自己的网站(16)
Based on vs2017 and cmake GUI configuration, zxing and opencv are used in win10 x64 environment, and simple detection of data matrix code is realized
[untitled]
2023年深圳市绿色低碳产业扶持计划申报指南
S7-200smart uses V90 Modbus communication control library to control the specific methods and steps of V90 servo
浅浅的谈一下ThreadLocalInsecureRandom
Build your own website (16)
Is it safe for Guosen Securities to open an account online?
BZOJ 3747 POI2015 Kinoman 段树
Is it safe for Anxin securities to open an account online?
leetcode刷题:二叉树15(找树左下角的值)
Let's talk about threadlocalinsecurerandom
c——顺序结构
通配符选择器
银河证券在网上开户安全吗?
Float. The specific meaning of the return value of floattorawintbits is to convert float into byte array
leetcode刷题:二叉树18(最大二叉树)
Win10 x64环境下基于VS2017和cmake-gui配置使用zxing以及opencv,并实现data metrix码的简单检测
Xaas trap: all things serve (possible) is not what it really needs
Using repositoryprovider to simplify the value passing of parent-child components