Home  >  Article  >  Backend Development  >  php基础,这个程序为什么显示空白页,那里错了?怎么让它输出排序后的结果

php基础,这个程序为什么显示空白页,那里错了?怎么让它输出排序后的结果

WBOY
WBOYOriginal
2016-06-13 11:42:35886browse

php基础,这个程序为什么显示空白页,那里错了?如何让它输出排序后的结果

本帖最后由 u013071929 于 2013-12-11 22:59:16 编辑
$prodects = array(array('TIR','Tires',100),
array('OIL','Oil',10),
array('SPK','Spark plugs',4));

function compare($x,$y)
{
if($x[1] == $y[1]) //这里的x[1]和y[1]代表什么值?
{
return 0;
}else if($x[1]<$y[1])
{
return -1;
}else
{
return 1;
}
}
usort($products,'compare');

foreach($products as $key)
{
echo '|'.$key.'|';
}
echo "
";
?>

php基础,这个程序为什么显示空白页,那里错了?如何让它输出排序后的结果,
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