我在 WAMP 服务器中测试了这段代码
<?php
$conn = mysql_connect ("localhost", "root","") or die (mysql_error());
mysql_set_charset('utf8',$conn);
mysql_select_db ("movedb");
$values = new Array();
$i = 0;
$text = $_POST['jam'];
$arrayText = explode(" ", $text);
foreach($arrayText as $val) {
$query = mysql_query("SELECT * FROM WORD WHERE ENGLISH = '$val'");
while($r = mysql_fetch_array($query)) {
$values[$s] = $r['SINHALA'];
$i++;
}
}
foreach($values as $val) {
echo $val.' ';
}
?>
但显示此错误
Parse error: syntax error, unexpected 'Array' (T_ARRAY)