js使用PHP数组
在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