|
|
|
ถามต่อเรื่อง Array ครับ จากคำสั่งนี้ผมต้อง select ข้อมูลจากด้าต้ามาทำการ Sort |
|
|
|
|
|
|
|
<?
//$a = ' "100" => Chalermchai , "300" => Werachai , "200" => Somchai';
$b = array ("100" => Chalermchai , "300" => Werachai , "200" => Somchai);
if(krsort($b))
{
foreach ($b as $mon => $name)
{
echo"" .$name." = ".$mon."<br>";
}
}
?>
Werachai = 300
Somchai = 200
Chalermchai = 100
ใช่แบบนี้หรือเปล่าครับ
|
|
|
|
|
Date :
2008-12-30 09:40:47 |
By :
jud |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$a= array("100" => Chalermchai , "300" => Werachai , "200" => Somchai);
//$b = array ("100" => Chalermchai , "300" => Werachai , "200" => Somchai);
$b = $a;
if(krsort($b))
{
foreach ($b as $mon => $name)
{
echo"" .$name." = ".$mon."<br>";
}
}
?>
|
|
|
|
|
Date :
2008-12-30 09:41:07 |
By :
jud |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|