当前位置:Gxlcms > PHP教程 > 正则表达式-php正则提取字符并转化成数组形式

正则表达式-php正则提取字符并转化成数组形式

时间:2021-07-01 10:21:17 帮助过:37人阅读

{"div_class":"deal","pinpai_link":""},{"div_class":"deal","pinpai_link":""}
需要把{}形式的匹配成数组。

回复内容:

{"div_class":"deal","pinpai_link":""},{"div_class":"deal","pinpai_link":""}
需要把{}形式的匹配成数组。

$text = '{"div_class":"deal","pinpai_link":""},{"div_class":"deal","pinpai_link":""}';
print_r( json_decode ( "[$text]", true ) );

人气教程排行