How does the php array output the following images in javascript? The php array contains the url image path. PHP array format: {code...} How does the php array output the following images in javascript? The php array contains the url image path. PHP array format:
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', });
The problem has been disabled. cause:
Reply content:
How does the php array output the following images in javascript? The php array contains the url image path. PHP array format:
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', });
If you want to output JSONjson_encodeIs to convert the array to JSON,json_decodeIs to convert JSON into an array. It must be usable. You can talk about your specific problems.
If you just want to output what you mentioned
Images: ['images/sample-1.jpg ', 'images/sample-2.jpg', 'images/sample-3.jpg ', 'images/sample-4.jpg', 'images/sample-5.jpg ']
Just spell the string.
Why is an error reported for the section you gave? Isn't it an array. No textures are available in the reply. I will add them here.
Can this be done after splicing?
$array = ('a', 'b', 'c');$array = array_map(create_function('$a', 'return "\"$a\"";'), $array);$arr_js = '['.implde(',', $array).']';
However, you can consider outputting the result as a json call.
Is it a Json string? Encodingjson_encode($array)Decodingjson_decode()
Depressed. What should I do? Php