Home >Backend Development >PHP Tutorial >php向js函数传参的几种方法_PHP

php向js函数传参的几种方法_PHP

WBOY
WBOYOriginal
2016-05-31 19:31:031143browse

<&#63;php 
echo "<script>test('$_POST[userid]');</script> ";
&#63;>

在上面的$_POST['']也可适用$_SESSION[' '];

<&#63;php 
$para = "hello boby!"; 
echo $para; 
echo "<script> var para=\"$para\"; alert(para);</script>"; 
&#63;>;

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