[php]array_flip 交換陣列中的鍵和值
(PHP 4, PHP 5)
官方範例:
<?php
$trans = array("a" => 1, "b" => 1, "c" => 2);
$trans = array_flip($trans);
print_r($trans);
?>
Array
(
[1] => b
[2] => c
)
全站熱搜
[php]array_flip 交換陣列中的鍵和值
(PHP 4, PHP 5)
官方範例:
<?php
$trans = array("a" => 1, "b" => 1, "c" => 2);
$trans = array_flip($trans);
print_r($trans);
?>
Array
(
[1] => b
[2] => c
)