我尝试了许多不同的方法,但我无法从数组中取消设置变量。我从一个字符串开始并将其分解为一个数组,现在我想删除 Bill。我错过了什么?我已经访问了 php.net,但我仍然卡住了......
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?php
$names = "Harry George Bill David Sam Jimmy";
$Allname = explode(" ",$names);
unset($Allname['Bill']);
sort($Allname);
$together = implode("," ,$Allname);
echo "$together";
?>
</body>
</html>