js使用PHP数组
xuexi 2024-02-05 10:30:01 发表在:PHP 查看数:645

在php中有数组,需要在js中使用 PHP中如下:

原始数据:
$arr =['18th', '20th', '22nd', '24th', '26th', '28th', '30th'];
处理后 json_encode()
 $shuju['riqi']=json_encode( ['18th', '20th', '22nd', '24th', '26th', '28th', '30th']);

在JS中需要使用到{!! htmlspecialchars_decode() !!}, 如下:

{!! htmlspecialchars_decode($shuju['riqi']) !!},
最近访问时间:2025-01-18 14:43:29
知识库:318条鸣谢:TAY  备案号:蜀ICP备2024090044号