呵呵,刚刚给你写了一个,不知道是不是你像要的?
<html>
<head>
<title>Open Window </title>
<?php
error_reporting(0);
$text=array("nihao","xiexie","你好","谢谢");
for($i=0;$i<count($text);$i++)
{
$text_str.=$text[$i].",";
}
?><script language="JavaScript">
OpenWindow('<?php echo $text_str; ?>');
function OpenWindow(text)
{
var arr = text.split(',');
alert("整个字符串的值:"+arr);
for(var i=0;i<(arr.length)-1;i++)
{
alert("值 "+i+" :"+arr[i]);
}
}
</script>
</head>
<body>
<html>
<head>
<title>Open Window </title>
<?php
error_reporting(0);
$text=array("nihao","xiexie","你好","谢谢");
for($i=0;$i<count($text);$i++)
{
$text_str.=$text[$i].",";
}
?><script language="JavaScript">
OpenWindow('<?php echo $text_str; ?>');
function OpenWindow(text)
{
var arr = text.split(',');
alert("整个字符串的值:"+arr);
for(var i=0;i<(arr.length)-1;i++)
{
alert("值 "+i+" :"+arr[i]);
}
}
</script>
</head>
<body>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货