

$result = json_decode($data, true);
if (json_last_error() !== \JSON_ERROR_NONE) {
$message = "Invalid json: $data".PHP_EOL;
if (function_exists('json_last_error_msg')) {
$message .= ': ' . json_last_error_msg();
}
throw new \RuntimeException($message);
}
//var_dump($data);
$result = json_decode($data, true);
//var_dump($result);
var_dump(json_last_error());
if (json_last_error() !== \JSON_ERROR_NONE) {
//dd(json_last_error());
$message = "Invalid json: $data".PHP_EOL;
if (function_exists('json_last_error_msg')) {
$message .= ': ' . json_last_error_msg();
}
throw new \RuntimeException($message);
}
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)

int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(4)
//var_dump($data);
$result = json_decode($data, true);
//var_dump($result);
//var_dump(json_last_error());
//exit;
if (json_last_error() !== \JSON_ERROR_NONE) {
var_dump($data);
var_dump($result);
var_dump(json_last_error());
exit;
//dd(json_last_error());
$message = "Invalid json: $data".PHP_EOL;
if (function_exists('json_last_error_msg')) {
$message .= ': ' . json_last_error_msg();
}
throw new \RuntimeException($message);
}
string(872) "
{
"sections": {
"collection": {
"type": "collection",
"settings": {
"slug": "{{ $CollectionsSlug }}",
"page": {{ Request::query('page') ?? '1' }}
}
},
"carousel": {
"type": "carousel",
"settings": {
"color_scheme": "inverse",
"loop": true,
"autoplay": true,
"interval": 10,
"slidesPerView": 6
},
"blocks": {
"slide-1": {
"type": "slide",
"settings": {
"image": "https://cdn.cloudfastin.com/assets/2021/06/4fdfbe61604c5abe7e07746042e532b1.jpg"
}
},
"slide-2": {
"type": "slide",
"settings": {
"image": "https://cdn.cloudfastin.com/assets/2021/06/45077c55aa09821c24aa1610ff7d3830.jpg"
}
}
}
}
}
}
"
NULL
int(4)

if (json_last_error() === \JSON_ERROR_SYNTAX) {
echo 'JSON_ERROR_SYNTAX';
}

$result = json_decode($data, true);
var_dump($data);
var_dump($result);
var_dump(json_last_error());
if (json_last_error() !== \JSON_ERROR_NONE) {
$message = "Invalid json: $data".PHP_EOL;
if (function_exists('json_last_error_msg')) {
$message .= ': ' . json_last_error_msg();
}
throw new \RuntimeException($message);
}
string(838) "
{
"sections": {
"collection": {
"type": "collection",
"settings": {
"slug": "{{ $CollectionsSlug }}",
"page": "{{ Request::query('page') ?? '1' }}"
}
},
"carousel": {
"type": "carousel",
"settings": {
"color_scheme": "inverse",
"loop": true,
"autoplay": true,
"interval": 10,
"slidesPerView": 6
},
"blocks": {
"slide-1": {
"type": "slide",
"settings": {
"image": "https://cdn.cloudfastin.com/assets/2021/06/4fdfbe61604c5abe7e07746042e532b1.jpg"
}
},
"slide-2": {
"type": "slide",
"settings": {
"image": "https://cdn.cloudfastin.com/assets/2021/06/45077c55aa09821c24aa1610ff7d3830.jpg"
}
}
}
}
}
}
"
array(1) {
["sections"]=>
array(2) {
["collection"]=>
array(2) {
["type"]=>
string(10) "collection"
["settings"]=>
array(2) {
["slug"]=>
string(22) "{{ $CollectionsSlug }}"
["page"]=>
string(35) "{{ Request::query('page') ?? '1' }}"
}
}
["carousel"]=>
array(3) {
["type"]=>
string(8) "carousel"
["settings"]=>
array(5) {
["color_scheme"]=>
string(7) "inverse"
["loop"]=>
bool(true)
["autoplay"]=>
bool(true)
["interval"]=>
int(10)
["slidesPerView"]=>
int(6)
}
["blocks"]=>
array(2) {
["slide-1"]=>
array(2) {
["type"]=>
string(5) "slide"
["settings"]=>
array(1) {
["image"]=>
string(79) "https://cdn.cloudfastin.com/assets/2021/06/4fdfbe61604c5abe7e07746042e532b1.jpg"
}
}
["slide-2"]=>
array(2) {
["type"]=>
string(5) "slide"
["settings"]=>
array(1) {
["image"]=>
string(79) "https://cdn.cloudfastin.com/assets/2021/06/45077c55aa09821c24aa1610ff7d3830.jpg"
}
}
}
}
}
}
int(0)
需要长期技术维护或远程问题排查?
我是拥有 15+ 年经验的 PHP / Go 后端工程师,长期关注已有系统维护、Bug 修复、性能优化、服务器排查、WordPress 网站维护和小功能迭代。
如果你的项目遇到以下情况,可以先从一次小问题排查开始合作:
- ✅ PHP / Laravel / Yii2 老项目无人维护
- ✅ Go / Gin 后端接口需要排查或优化
- ✅ WordPress 网站访问慢、报错或插件冲突
- ✅ Nginx / MySQL / Redis / Linux 服务器异常
- ✅ CDN / Cloudflare / DNS / HTTPS 配置问题
- ✅ 需要长期远程技术支持或兼职维护
更多介绍请查看:关于我 & 合作
微信:13980074657
邮箱:shuijingwanwq@gmail.com
Telegram:@shuijingwan
GitHub:https://github.com/shuijingwan

发表回复