7.1.13、交换数组的键和值

 
 PHP Code By tony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php

    /**
        交换数组中的键和值
     */

    $userNames = 
array('tony'=>26,'xiaosi'=>26,'jacky'=>25);
    
    print_r($userNames);
    
    
echo '<br>';
    
    $newUserNames = array_flip($userNames);
    
    print_r($newUserNames);
    
?>




原文地址:https://www.cnblogs.com/tonycody/p/2795371.html