PHP生成JS有关问题

WBOY
Release: 2016-06-13 13:01:37
Original
796 people have browsed it

PHP生成JS问题
从后台生成一个js文件,格式如下:
_list的下标必须是从0开始计数,如:0123,不能是0124

_list[0] = {<br />
	title:'',<br />
	timg:'1.jpg',<br />
	img:2.jpg',<br />
	listimg:3.jpg',<br />
	picwidth:'400',<br />
	picheight:'400',<br />
	morelink:''<br />
};<br />
_list[1] = {<br />
	title:'',<br />
	timg:'1.jpg',<br />
	img:2.jpg',<br />
	listimg:3.jpg',<br />
	picwidth:'400',<br />
	picheight:'400',<br />
	morelink:''<br />
};
Copy after login

------解决方案--------------------
二维数组,再json_encode() 
------解决方案--------------------
用list.1.title吧

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template