php数组怎么输出成javascript中下面images值得样子?php数组中是url图片路径。 PHP数组格式为:
Array([0] => http://XXX/xgsyw/content/Uploads/Img/1111.jpg[1] => http://XXX/xgsyw/content/Uploads/Img/222.jpg)
$('#top').bgStretcher({
images: ['images/sample-1.jpg', 'images/sample-2.jpg', 'images/sample-3.jpg', 'images/sample-4.jpg', 'images/sample-5.jpg', 'images/sample-6.jpg'],
slideDirection: 'N',
slideShowSpeed: 1000,
transitionEffect: 'fade',
sequenceMode: 'normal',
});
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
拼接的话看看这样可以么?
不过其实可以考虑输出成json前段获取调用就是了。
是要输出Json字符串吗? 编码用
json_encode($array)解码用json_decode()郁闷了,还是不成。到底怎么办呢?php啊