split()问题。
|
当我尝试启动PHP脚本时,出现以下错误:[错误] [客户端:: 1] PHP解析错误:语法错误,在第16行的/var/www/loterija.php中出现意外的T_VARIABLE
我认为问题出在split()函数上。这是代码:
<?php
$arr = array();
if(isset($_POST[\'roll\'])):
echo \"Lucky numbers: \" . \'<br />\';
for ($i = 1; $i <= 5; $i++) {
$arr[] = rand(1, 100);
}
$post = $_POST[\'numbers\'];
echo \'<br />\' . \"Your numbers: \" . \'<br />\';
$split = split(\" \", $post, 5);
endif;
?>
<html>
<head>
<title>Lottery Script</title>
</head>
<body>
<form action=\"#\" method=\"post\">
Enter five numbers: <input type=\"text\" name=\"numbers\" />
<input type=\"submit\" name=\"roll\" value=\"Roll!\" />
</form>
</body>
</html>
没有找到相关结果
已邀请:
3 个回复
磐剩
撵穆
,并且已弃用。 这样做:
悲帽慑彤电
或
。 http://us.php.net/manual/zh/function.split.php