PHP绫诲瀷涔嬫暟缁勪粙缁

鏁扮粍锛孭HP 涓殑 鏁扮粍 瀹為檯涓婃槸涓涓湁搴忔槧灏勩傛槧灏勬槸涓绉嶆妸 values 鍏宠仈鍒 keys 鐨勭被鍨嬨

鏁扮粍
PHP 涓殑 鏁扮粍 瀹為檯涓婃槸涓涓湁搴忔槧灏勩傛槧灏勬槸涓绉嶆妸 values 鍏宠仈鍒 keys 鐨勭被鍨嬨傛绫诲瀷鍦ㄥ緢澶氭柟闈㈠仛浜嗕紭鍖栵紝鍥犳鍙互鎶婂畠褰撴垚鐪熸鐨勬暟缁勶紝鎴栧垪琛紙鍚戦噺锛夛紝鏁e垪琛紙鏄槧灏勭殑涓绉嶅疄鐜帮級锛屽瓧鍏革紝闆嗗悎锛屾爤锛岄槦鍒椾互鍙婃洿澶氬彲鑳芥с傛暟缁勫厓绱犵殑鍊间篃鍙互鏄彟涓涓暟缁勩傛爲褰㈢粨鏋勫拰澶氱淮鏁扮粍涔熸槸鍏佽鐨勩

瑙i噴杩欎簺缁撴瀯瓒呭嚭浜嗘湰鎵嬪唽鐨勮寖鍥达紝浣嗗浜庢瘡绉嶇粨鏋勮嚦灏戜細鎻愪緵涓涓緥瀛愩傝寰楀埌杩欎簺缁撴瀯鐨勬洿澶氫俊鎭紝寤鸿鍙傝冩湁鍏虫骞块様涓婚鐨勫叾瀹冭憲浣溿

璇硶
瀹氫箟鏁扮粍 array()
鍙互鐢 array() 璇█缁撴瀯鏉ユ柊寤轰竴涓 array銆傚畠鎺ュ彈浠绘剰鏁伴噺鐢ㄩ楀彿鍒嗛殧鐨 閿(key) => 鍊(value) 瀵广

array(  key =>  value
     , ...
     )
// 閿(key) 鍙槸鏄竴涓 鏁存暟(integer) 鎴 瀛楃涓(string)
// 鍊(value) 鍙互鏄换鎰忕被鍨嬬殑鍊
<?php
$arr = array("foo" => "bar", 12 => true);

echo $arr["foo"]; // bar
echo $arr[12];    // 1
?>
key 鍙互鏄 integer 鎴栬 string銆傚鏋渒ey鏄竴涓 integer 鐨勬爣鍑嗚〃绀猴紝鍒欒瑙i噴涓烘暣鏁帮紙渚嬪 "8" 灏嗚瑙i噴涓 8锛岃 "08" 灏嗚瑙i噴涓 "08"锛夈俴ey 涓殑娴偣鏁拌鍙栨暣涓 integer銆傚湪 PHP 涓储寮曟暟缁勪笌鍏宠仈 鏁扮粍 鏄浉鍚岀殑锛屽畠浠兘鍙互鍚屾椂鍖呭惈 鏁村瀷 鍜 瀛楃涓 鐨勪笅鏍囥

鍊煎彲浠ユ槸浠绘剰鐨 PHP 绫诲瀷銆

<?php
$arr = array("somearray" => array(6 => 5, 13 => 9, "a" => 42));

echo $arr["somearray"][6];    // 5
echo $arr["somearray"][13];   // 9
echo $arr["somearray"]["a"];  // 42
?>
濡傛灉瀵圭粰鍑虹殑鍊兼病鏈夋寚瀹氶敭鍚嶏紝鍒欏彇褰撳墠鏈澶х殑鏁存暟绱㈠紩鍊硷紝鑰屾柊鐨勯敭鍚嶅皢鏄鍊煎姞涓銆傚鏋滄寚瀹氱殑閿悕宸茬粡鏈変簡鍊硷紝鍒欒鍊间細琚鐩栥

<?php
// 杩欎釜鏁扮粍涓庝笅闈㈢殑鏁扮粍鐩稿悓 ...
array(5 => 43, 32, 56, "b" => 12);

// ...
array(5 => 43, 6 => 32, 7 => 56, "b" => 12);
?> Warning
鑷 PHP 4.3.0 璧凤紝涓婅堪鐨勭储寮曠敓鎴愭柟娉曟敼鍙樹簡銆傚浠婂鏋滅粰涓涓綋鍓嶆渶澶ч敭鍚嶆槸璐熷肩殑鏁扮粍娣诲姞涓涓柊鍊硷紝鍒欐柊鐢熸垚鐨勭殑绱㈠紩灏嗕负闆讹紙0锛夈備互鍓嶆柊鐢熸垚鐨勭储寮曚负褰撳墠鏈澶х储寮曞姞涓锛屽拰姝e肩殑绱㈠紩鐩稿悓銆

浣跨敤 TRUE 浣滀负閿悕灏嗕娇 integer 1 鎴愪负閿悕銆備娇鐢 FALSE 浣滀负閿悕灏嗕娇 integer 0 鎴愪负閿悕銆備娇鐢 NULL 浣滀负閿悕灏嗙瓑鍚屼簬浣跨敤绌哄瓧绗︿覆銆備娇鐢ㄧ┖瀛楃涓蹭綔涓洪敭鍚嶅皢鏂板缓锛堟垨瑕嗙洊锛変竴涓敤绌哄瓧绗︿覆浣滀负閿悕鐨勫硷紝杩欏拰鐢ㄧ┖鐨勬柟鎷彿涓嶄竴鏍枫

涓嶈兘鐢ㄦ暟缁勫拰瀵硅薄浣滀负閿(key)銆傝繖鏍峰仛浼氬鑷翠竴涓鍛婏細Illegal offset type銆

鐢ㄦ柟鎷彿鐨勮娉曟柊寤猴紡淇敼
鍙互閫氳繃鏄庣ず鍦拌瀹氬兼潵鏀瑰彉涓涓幇鏈夌殑鏁扮粍銆

杩欐槸閫氳繃鍦ㄦ柟鎷彿鍐呮寚瀹氶敭鍚嶆潵缁欐暟缁勮祴鍊煎疄鐜扮殑銆備篃鍙互鐪佺暐閿悕锛屽湪杩欑鎯呭喌涓嬬粰鍙橀噺鍚嶅姞涓婁竴瀵圭┖鐨勬柟鎷彿锛堚淸]鈥濓級銆

$arr[key] = value;
$arr[] = value;
// key 鍙互鏄 integer 鎴 string
// value 鍙互鏄换鎰忕被鍨嬬殑鍊
濡傛灉 $arr 杩樹笉瀛樺湪锛屽皢浼氭柊寤轰竴涓傝繖涔熸槸涓绉嶅畾涔夋暟缁勭殑鏇挎崲鏂规硶銆傝鏀瑰彉涓涓硷紝鍙缁欏畠璧嬩竴涓柊鍊笺傚鏋滆鍒犻櫎涓涓敭鍚嶏紡鍊煎锛岃瀵瑰畠鐢 unset()銆

<?php
$arr = array(5 => 1, 12 => 2);

$arr[] = 56;    // This is the same as $arr[13] = 56;
                // at this point of the script

$arr["x"] = 42; // This adds a new element to
                // the array with key "x"
                
unset($arr[5]); // This removes the element from the array

unset($arr);    // This deletes the whole array
?>
Note:

濡備笂鎵杩帮紝濡傛灉缁欏嚭鏂规嫭鍙蜂絾娌℃湁鎸囧畾閿悕锛屽垯鍙栧綋鍓嶆渶澶ф暣鏁扮储寮曞硷紝鏂扮殑閿悕灏嗘槸璇ュ + 1銆傚鏋滃綋鍓嶈繕娌℃湁鏁存暟绱㈠紩锛屽垯閿悕灏嗕负 0銆傚鏋滄寚瀹氱殑閿悕宸茬粡鏈夊间簡锛岃鍊煎皢琚鐩栥

娉ㄦ剰杩欓噷鎵浣跨敤鐨勬渶澶ф暣鏁伴敭鍚嶄笉涓瀹氬綋鍓嶅氨鍦ㄦ暟缁勪腑銆傚畠鍙鍦ㄤ笂娆℃暟缁勯噸鏂扮敓鎴愮储寮曞悗鏇剧粡瀛樺湪杩囧氨琛屼簡銆備互涓嬮潰鐨勪緥瀛愭潵璇存槑锛

<?php
// 鍒涘缓涓涓畝鍗曠殑鏁扮粍
$array = array(1, 2, 3, 4, 5);
print_r($array);

// 鐜板湪鍒犻櫎鍏朵腑鐨勬墍鏈夊厓绱狅紝浣嗕繚鎸佹暟缁勬湰韬笉鍙:
foreach ($array as $i => $value) {
    unset($array[$i]);
}
print_r($array);

// 娣诲姞涓涓崟鍏冿紙娉ㄦ剰鏂扮殑閿悕鏄 5锛岃屼笉鏄綘鍙兘浠ヤ负鐨 0锛
$array[] = 6;
print_r($array);

// 閲嶆柊绱㈠紩锛
$array = array_values($array);
$array[] = 7;
print_r($array);
?>
浠ヤ笂渚嬬▼浼氳緭鍑猴細

Array
(
    [0] => 1
    [1] => 2
    [2] => 3
    [3] => 4
    [4] => 5
)
Array
(
)
Array
(
    [5] => 6
)
Array
(
    [0] => 6
    [1] => 7
)
瀹炵敤鍑芥暟
鏈夊緢澶氭搷浣滄暟缁勭殑鍑芥暟锛屽弬瑙佹暟缁勫嚱鏁颁竴鑺傘

Note:

unset() 鍑芥暟鍏佽鍒犻櫎鏁扮粍涓殑鏌愪釜閿備絾瑕佹敞鎰忔暟缁勫皢涓嶄細閲嶅缓绱㈠紩銆 If a true "remove and shift" behavior is desired, the array can be reindexed using the array_values() function.

<?php
$a = array(1 => 'one', 2 => 'two', 3 => 'three');
unset($a[2]);
/* will produce an array that would have been defined as
   $a = array(1 => 'one', 3 => 'three');
   and NOT
   $a = array(1 => 'one', 2 =>'three');
*/

$b = array_values($a);
// Now $b is array(0 => 'one', 1 =>'three')
?>
foreach 鎺у埗缁撴瀯鏄笓闂ㄧ敤浜庢暟缁勭殑銆傚畠鎻愪緵浜嗕竴涓畝鍗曠殑鏂规硶鏉ラ亶鍘嗘暟缁勩

鏁扮粍鍋氫粈涔堝拰涓嶅仛浠涔
涓轰粈涔 $foo[bar] 閿欎簡锛
搴旇濮嬬粓鍦ㄧ敤瀛楃涓茶〃绀虹殑鏁扮粍绱㈠紩涓婂姞涓婂紩鍙枫備緥濡傜敤 $foo['bar'] 鑰屼笉鏄 $foo[bar]銆備絾鏄负浠涔 $foo[bar] 閿欎簡鍛紵鍙兘鍦ㄨ佺殑鑴氭湰涓杩囧涓嬭娉曪細

<?php
$foo[bar] = 'enemy';
echo $foo[bar];
// etc
?>
杩欐牱鏄敊鐨勶紝浣嗗彲浠ユ甯歌繍琛屻傞偅涔堜负浠涔堥敊浜嗗憿锛熷師鍥犳槸姝や唬鐮佷腑鏈変竴涓湭瀹氫箟鐨勫父閲忥紙bar锛夎屼笉鏄瓧绗︿覆锛'bar'锛嶆敞鎰忓紩鍙凤級锛岃 PHP 鍙兘浼氬湪浠ュ悗瀹氫箟姝ゅ父閲忥紝涓嶅垢鐨勬槸浣犵殑浠g爜涓湁鍚屾牱鐨勫悕瀛椼傚畠鑳借繍琛岋紝鏄洜涓 PHP 鑷姩灏嗚8瀛楃涓诧紙娌℃湁寮曞彿鐨勫瓧绗︿覆涓斾笉瀵瑰簲浜庝换浣曞凡鐭ョ鍙凤級杞崲鎴愪竴涓叾鍊间负璇ヨ8瀛楃涓茬殑姝e父瀛楃涓层備緥濡傦紝濡傛灉娌℃湁甯搁噺瀹氫箟涓 bar锛孭HP 灏嗘妸瀹冩浛浠d负 'bar' 骞朵娇鐢ㄤ箣銆

Note: 杩欏苟涓嶆剰鍛崇潃鎬绘槸缁欓敭鍚嶅姞涓婂紩鍙枫傜敤涓嶇潃缁欓敭鍚嶄负甯搁噺鎴栧彉閲忕殑鍔犱笂寮曞彿锛屽惁鍒欎細浣 PHP 涓嶈兘瑙f瀽瀹冧滑銆 <?php
error_reporting(E_ALL);
ini_set('display_errors', true);
ini_set('html_errors', false);
// Simple array:
$array = array(1, 2);
$count = count($array);
for ($i = 0; $i < $count; $i++) {
    echo " Checking $i:  ";
    echo "Bad: " . $array['$i'] . " ";
    echo "Good: " . $array[$i] . " ";
    echo "Bad: {$array['$i']} ";
    echo "Good: {$array[$i]} ";
}
?>

浠ヤ笂渚嬬▼浼氳緭鍑猴細

Checking 0: 
Notice: Undefined index:  $i in /path/to/script.html on line 9
Bad: 
Good: 1
Notice: Undefined index:  $i in /path/to/script.html on line 11
Bad: 
Good: 1

Checking 1: 
Notice: Undefined index:  $i in /path/to/script.html on line 9
Bad: 
Good: 2
Notice: Undefined index:  $i in /path/to/script.html on line 11
Bad: 
Good: 2
婕旂ず姝よ涓虹殑鏇村渚嬪瓙锛

<?php
// Show all errors
error_reporting(E_ALL);

$arr = array('fruit' => 'apple', 'veggie' => 'carrot');

// Correct
print $arr['fruit'];  // apple
print $arr['veggie']; // carrot

// Incorrect.  This works but also throws a PHP error of level E_NOTICE because
// of an undefined constant named fruit
// 
// Notice: Use of undefined constant fruit - assumed 'fruit' in...
print $arr[fruit];    // apple

// This defines a constant to demonstrate what's going on.  The value 'veggie'
// is assigned to a constant named fruit.
define('fruit', 'veggie');

// Notice the difference now
print $arr['fruit'];  // apple
print $arr[fruit];    // carrot

// The following is okay, as it's inside a string. Constants are not looked for
// within strings, so no E_NOTICE occurs here
print "Hello $arr[fruit]";      // Hello apple

// With one exception: braces surrounding arrays within strings allows constants
// to be interpreted
print "Hello {$arr[fruit]}";    // Hello carrot
print "Hello {$arr['fruit']}";  // Hello apple

// This will not work, and will result in a parse error, such as:
// Parse error: parse error, expecting T_STRING' or T_VARIABLE' or T_NUM_STRING'
// This of course applies to using superglobals in strings as well
print "Hello $arr['fruit']";
print "Hello $_GET['foo']";

// Concatenation is another option
print "Hello " . $arr['fruit']; // Hello apple
?>
褰撴墦寮 error_reporting 鏉ユ樉绀 E_NOTICE 绾у埆鐨勯敊璇紙渚嬪灏嗗叾璁句负 E_ALL锛夋椂灏嗙湅鍒拌繖浜涢敊璇傞粯璁ゆ儏鍐典笅 error_reporting 琚叧闂笉鏄剧ず杩欎簺銆

鍜屽湪璇硶涓鑺備腑瑙勫畾鐨勪竴鏍凤紝鍦ㄦ柟鎷彿锛堚淸鈥濆拰鈥淽鈥濓級涔嬮棿蹇呴』鏈変竴涓〃杈惧紡銆傝繖鎰忓懗鐫鍙互杩欐牱鍐欙細

<?php
echo $arr[somefunc($bar)];
?>
杩欐槸涓涓敤鍑芥暟杩斿洖鍊间綔涓烘暟缁勭储寮曠殑渚嬪瓙銆侾HP 涔熷彲浠ョ敤宸茬煡甯搁噺锛屽彲鑳戒箣鍓嶅凡缁忚杩

<?php
$error_descriptions[E_ERROR]   = "A fatal error has occured";
$error_descriptions[E_WARNING] = "PHP issued a warning";
$error_descriptions[E_NOTICE]  = "This is just an informal notice";
?>
娉ㄦ剰 E_ERROR 涔熸槸涓悎娉曠殑鏍囪瘑绗︼紝灏卞拰绗竴涓緥瀛愪腑鐨 bar 涓鏍枫備絾鏄笂涓涓緥瀛愬疄闄呬笂鍜屽涓嬪啓娉曟槸涓鏍风殑锛

<?php
$error_descriptions[1] = "A fatal error has occured";
$error_descriptions[2] = "PHP issued a warning";
$error_descriptions[8] = "This is just an informal notice";
?>
鍥犱负 E_ERROR 绛変簬 1, 绛夌瓑.

閭d箞涓轰粈涔堣繖鏍峰仛涓嶅ソ锛
涔熻鏈変竴澶╋紝PHP 寮鍙戝皬缁勫彲鑳戒細鎯虫柊澧炰竴涓父閲忔垨鑰呭叧閿瓧锛屾垨鑰呯敤鎴峰彲鑳藉笇鏈涗互鍚庡湪鑷繁鐨勭▼搴忎腑寮曞叆鏂扮殑甯搁噺锛岄偅灏辨湁楹荤儲浜嗐備緥濡傚凡缁忎笉鑳借繖鏍风敤 empty 鍜 default 杩欎袱涓瘝浜嗭紝鍥犱负浠栦滑鏄繚鐣欏瓧銆

Note: 閲嶇敵涓娆★紝鍦ㄥ弻寮曞彿瀛楃涓蹭腑锛屼笉缁欑储寮曞姞涓婂紩鍙锋槸鍚堟硶鐨勫洜姝 "$foo[bar]"鏄悎娉曠殑锛堚滃悎娉曗濈殑鍘熸枃涓簐alid銆傚湪瀹為檯娴嬭瘯涓紝杩欎箞鍋氱‘瀹炲彲浠ヨ闂暟缁勭殑璇ュ厓绱狅紝浣嗘槸浼氭姤涓涓父閲忔湭瀹氫箟鐨刵otice銆傛棤璁哄浣曪紝寮虹儓寤鸿涓嶈浣跨敤$foo[bar]杩欐牱鐨勫啓娉曪紝鑰岃浣跨敤$foo['bar']鏉ヨ闂暟缁勪腑鍏冪礌銆--haohappy娉級銆傝嚦浜庝负浠涔堝弬瑙佷互涓婄殑渚嬪瓙鍜屽瓧绗︿覆涓殑鍙橀噺瑙f瀽涓殑瑙i噴銆

杞崲涓烘暟缁
瀵逛簬浠绘剰绫诲瀷: integer, float, string, boolean and resource,濡傛灉灏嗕竴涓艰浆鎹负鏁扮粍锛屽皢寰楀埌涓涓粎鏈変竴涓厓绱犵殑鏁扮粍锛堝叾涓嬫爣涓 0锛夛紝璇ュ厓绱犲嵆涓烘鏍囬噺鐨勫笺傛崲鍙ヨ瘽璇达紝 (array)$scalarValue 涓 array($scalarValue) 瀹屽叏涓鏍枫

If an object is converted to an array, the result is an array whose elements are the object's properties. The keys are the member variable names, with a few notable exceptions: integer properties are unaccessible; private variables have the class name prepended to the variable name; protected variables have a '*' prepended to the variable name. These prepended values have null bytes on either side. This can result in some unexpected behaviour:

<?php

class A {
    private $A; // This will become 'AA'
}

class B extends A {
    private $A; // This will become 'BA'
    public $AA; // This will become 'AA'
}

var_dump((array) new B());
?>
The above will appear to have two keys named 'AA', although one of them is actually named 'AA'.

灏 NULL 杞崲鍒 鏁扮粍(array) 浼氬緱鍒颁竴涓┖鐨勬暟缁勩

姣旇緝
鍙兘浣跨敤 array_diff() 鍜屾暟缁勮繍绠楃鏉ユ瘮杈冩暟缁勩

Examples
PHP 涓殑鏁扮粍绫诲瀷鏈夐潪甯稿鐨勭敤閫旓紝鍥犳杩欓噷鏈変竴浜涗緥瀛愬睍绀烘暟缁勭殑瀹屾暣濞佸姏銆

<?php
// This:
$a = array( 'color' => 'red',
            'taste' => 'sweet',
            'shape' => 'round',
            'name'  => 'apple',
            4        // key will be 0
          );

$b = array('a', 'b', 'c');

// . . .is completely equivalent with this:
$a = array();
$a['color'] = 'red';
$a['taste'] = 'sweet';
$a['shape'] = 'round';
$a['name']  = 'apple';
$a[]        = 4;        // key will be 0

$b = array();
$b[] = 'a';
$b[] = 'b';
$b[] = 'c';

// After the above code is executed, $a will be the array
// array('color' => 'red', 'taste' => 'sweet', 'shape' => 'round', 
// 'name' => 'apple', 0 => 4), and $b will be the array 
// array(0 => 'a', 1 => 'b', 2 => 'c'), or simply array('a', 'b', 'c').
?>
Example #1 Using array()

<?php
// Array as (property-)map
$map = array( 'version'    => 4,
              'OS'         => 'Linux',
              'lang'       => 'english',
              'short_tags' => true
            );
            
// strictly numerical keys
$array = array( 7,
                8,
                0,
                156,
                -10
              );
// this is the same as array(0 => 7, 1 => 8, ...)

$switching = array(         10, // key = 0
                    5    =>  6,
                    3    =>  7, 
                    'a'  =>  4,
                            11, // key = 6 (maximum of integer-indices was 5)
                    '8'  =>  2, // key = 8 (integer!)
                    '02' => 77, // key = '02'
                    0    => 12  // the value 10 will be overwritten by 12
                  );
                  
// empty array
$empty = array();         
?>
Example #2 闆嗗悎

<?php
$colors = array('red', 'blue', 'green', 'yellow');

foreach ($colors as $color) {
    echo "Do you like $color? ";
}

?>
浠ヤ笂渚嬬▼浼氳緭鍑猴細

Do you like red?
Do you like blue?
Do you like green?
Do you like yellow?
鐩存帴鏀瑰彉鏁扮粍鐨勫煎湪 PHP 5 涓彲浠ラ氳繃寮曠敤浼犻掓潵鍋氬埌銆備箣鍓嶇殑鐗堟湰闇瑕侀渶瑕侀噰鍙栧彉閫氱殑鏂规硶锛

Example #3 闆嗗悎

<?php
// PHP 5
foreach ($colors as &$color) {
    $color = strtoupper($color);
}
unset($color); /* ensure that following writes to
$color will not modify the last array element */

// Workaround for older versions
foreach ($colors as $key => $color) {
    $colors[$key] = strtoupper($color);
}

print_r($colors);
?>
浠ヤ笂渚嬬▼浼氳緭鍑猴細

Array
(
    [0] => RED
    [1] => BLUE
    [2] => GREEN
    [3] => YELLOW
)
鏈緥鐢熸垚涓涓笅鏍囦粠1寮濮嬬殑鏁扮粍銆俆his example creates a one-based array.

Example #4 涓嬫爣浠1寮濮嬬殑鏁扮粍

<?php
$firstquarter  = array(1 => 'January', 'February', 'March');
print_r($firstquarter);
?>
浠ヤ笂渚嬬▼浼氳緭鍑猴細

Array 
(
    [1] => 'January'
    [2] => 'February'
    [3] => 'March'
)
Example #5 濉厖鏁扮粍

<?php
// fill an array with all items from a directory
$handle = opendir('.');
while (false !== ($file = readdir($handle))) {
    $files[] = $file;
}
closedir($handle); 
?>
鏁扮粍鏄湁搴忕殑銆備篃鍙互浣跨敤涓嶅悓鐨勬帓搴忓嚱鏁版潵鏀瑰彉椤哄簭銆傛洿澶氫俊鎭弬瑙佹暟缁勫嚱鏁般傚彲浠ョ敤 count() 鍑芥暟鏉ユ暟鍑烘暟缁勪腑鍏冪礌鐨勪釜鏁般

Example #6 鏁扮粍鎺掑簭

<?php
sort($files);
print_r($files);
?>
鍥犱负鏁扮粍涓殑鍊煎彲浠ヤ负浠绘剰鍊硷紝涔熷彲鏄彟涓涓暟缁勩傝繖鏍峰彲浠ヤ骇鐢熼掑綊鎴栧缁存暟缁勩

Example #7 閫掑綊鍜屽缁存暟缁

<?php
$fruits = array ( "fruits"  => array ( "a" => "orange",
                                       "b" => "banana",
                                       "c" => "apple"
                                     ),
                  "numbers" => array ( 1,
                                       2,
                                       3,
                                       4,
                                       5,
                                       6
                                     ),
                  "holes"   => array (      "first",
                                       5 => "second",

浠ヤ笂灏辨槸PHP绫诲瀷涔嬫暟缁勪粙缁嶇殑璇︾粏鍐呭锛屾洿澶氫俊鎭鍏虫敞OD浜戝叾瀹冪浉鍏虫枃绔狅紒



鏈枃URL锛http://www.odweb.cn/news_show.html?id=50