Home >Backend Development >PHP Tutorial > PHP生成JS有关问题

PHP生成JS有关问题

WBOY
WBOYOriginal
2016-06-13 13:01:37829browse

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 />
};

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

Statement:
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