Sagewire Logo

the usort 's puzzle

2 Message(s) by 2 Author(s) originally posted in php language


From: youngord Date:   Saturday, September 29, 2007
<?php
$mix=array(
array("A",10),
array("B",5),
array("C",100)
);
function com($x,$y){
echo $x[0];
}

usort($mix,'com');

?>

I think the $x[0] result is A,
but the final $x[0] result is BC.
why???


From: Erwin Moller Date:   Monday, October 01, 2007
wrote in message:
<?php
$mix=array(
array("A",10),
array("B",5),
array("C",100)
);
function com($x,$y){
echo $x[0];
}
usort($mix,'com');
?> I think the $x[0] result is A,
but the final $x[0] result is BC.
why???


Please stop multiposting.
You question was also send (and answered) in comp.lang.php, and who
knows where else....

Erwin Moller



Next Message: what new setup?


Blogs related to the usort 's puzzle

Antique, vintage, muscle and exotic collectors.
wheretobuykrispykremedonuts donating to aspca northwest georgia power credit union Letter to company for due amount php usort() materials for cooking pots euro tb max dog 92 20 97 20 93 6 www.jackmagazine.com titantic band plays autumn ...

The official Magazine Website features news and tests.
indonesia yellow pages. vdb tu ne vas pas crever php usort() wisconsin sales tax ambassador international orange grinnell ia 9 22156 7519 bridge collapse 35w minneapolis Amarige de givenchy perfume hillary clinton website precision ...

the usort s puzzle
?php $mix=array( array(A,10), array(B,5), array(C,100) ) function com($x,$y){ echo $x[0] } usort($mix,com) ? i think the $x[0] result is A, but the final $x[0] result is BC. why???

the usort s puzzle
comp.lang.php: the usort s puzzle.

the usort s puzzle
alt.php: the usort s puzzle.


Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional