Home  >  Article  >  Backend Development  >  不知道怎么把php数组传js

不知道怎么把php数组传js

WBOY
WBOYOriginal
2016-06-13 12:31:33910browse

不知道如何把php数组传js
$webdata[a]='111';
$webdata[b]='222';
$webdata[c]='333';
$webdata[d]='444';
echo "$webdata";
?>


<script> <br /> function getResult(webdata){ <br /> var abc=webfile; <br /> $("#aaa").val(abc[0]);<br /> $("#bbb").val(abc[1]);<br /> $("#ccc").val(abc[2]);<br /> $("#ddd").val(abc[3]);<br /> } <br /> </script>








php输出一个数组给js,js如何把数组中数据 添加到input中,

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