...

View Full Version : multisort problem



begeiste
09-02-2007, 06:00 PM
Hi,
Not sure what is wrong with the function of array_multisort(), I have checked line by line, the error tells Parse error:
parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in d:\easyphp1-8\www\study\array_multisort.php on line 13.I don't understand whats wrong with my code which I have copied from php book.


<?php
$class=array("score" =>array(123,345,23,66,7,821,10,33,90,100), "name" =>array("Alice","Peter","Elvin","Sindy","Simon","Bob","Hank","Charlie","Caroline","Linda"));
`

array_multisort($class["score"],SORT_NUMERIC, SORT_DESC, $class["name"], SORT_STRING, SORT_ASC);


echo "<table bgcolor='#ffff99' border='2' width='80%'>";
echo "<tr><th>Score</th>";
for($a=0; $a<10; $a++){
echo "<td>".$class["score"][$a]."</td>";
}
echo "</tr><tr><th>Name</th>";
for($a=0; $a<10; $a++){
echo "<td>".$class["name"][$a]."</td>";
}
?>Can someone help me out this problem? Much appreciated!

dumpfi
09-02-2007, 07:46 PM
There's a superfluous back tick on the third line.

dumpfi

begeiste
09-03-2007, 07:26 AM
There's a superfluous back tick on the third line.

dumpfi

I appreciated. It works after removed this extraneous back tick.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum