天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

php數(shù)組總結(jié)篇(一)

數(shù)組
1.數(shù)組的下標(biāo)是整型數(shù)值或者是字符串類型。
eg1.索引數(shù)組的鍵是______,關(guān)聯(lián)數(shù)組的鍵是______。
2.字符串作為索引的時候,應(yīng)加上引號。常量或者變量不用加引號,否則無法編譯。
php中,沒有引號的字符串會自動生成一個裸字符串,而 php 可能會在以后定義此常量,不幸的是你的代碼中有同樣的名字,那么這個字符串就被重新賦值。
eg2.<?php
// 顯示所有錯誤
error_reporting(E_ALL);
$arr = array('fruit' => 'apple', 'veggie' => 'carrot');
// 正確
print $arr['fruit']; // apple
print $arr['veggie']; // carrot
// 不正確。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
// Let's define a constant to demonstrate what's going on. We
// will assign value 'veggie' 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 error here
print "Hello $arr[fruit]"; // Hello apple
// With one exception, braces surrounding arrays within strings
// allows constants to be looked for
print "Hello {$arr[fruit]}"; // Hello carrot
print "Hello {$arr['fruit']}"; // Hello apple
// This will not work, results 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 autoglobals in strings as well
print "Hello $arr['fruit']";
print "Hello $_GET['foo']";
// Concatenation is another option
print "Hello " . $arr['fruit']; // Hello apple
?>
3.鍵值問題
$a['color'] = 'red';
$a['taste'] = 'sweet';
$a['shape'] = 'round';
$a['name'] = 'apple';
$a[] = 4; // key will be 0
$b[] = 'a'; // key will be 0
$b[] = 'b'; // key will be 1
$b[] = 'c'; // key will be 2
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
);
<?php
$multi_array = array("red",
"green",
42 => "blue","yellow" => array("apple",9 => "pear","banana","orange" => array("dog","cat","iguana")));
?>
A.$multi_array['yellow']['apple'][0]
B.$multi_array['blue'][0]['orange'][1]
C.$multi_array[3][3][2]
D.$multi_array['yellow']['orange']['cat']
E.$multi_array['yellow']['orange'][1]
--------------------------------待續(xù)待續(xù)待續(xù)------
4.array_walk
5.var_dump
6.array_intersect
7.array_sum
8.array_count_values
9.array_flip
10.natsort
11.ksort(),asort(),krsort(),sort(),usort()
12.array_reverse()
13.array_merge
14.reset
-------------------------------待續(xù)待續(xù)待續(xù)------
15.array_combine
16array_count_values
17.array_diff
18.array_filter
19.array_search

php技術(shù)php數(shù)組總結(jié)篇(一),轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 一个人HD在线观看免费高清视频 | 国产精品亚洲第一区二区三区 | 91精品一区二区综合在线 | 中文字幕亚洲无线码高清不卡 | 特黄特色大片免费播放器9 特黄特黄aaaa级毛片免费看 | 国产野外无码理论片在线观看 | 国产亚洲精品AV麻豆狂野 | 国产成人一区二区三中文 | 琉璃美人煞在线观看 | 粉嫩自拍 偷拍 亚洲 | 桃花在线观看播放 | 亚洲精品国偷拍自产在线观看蜜臀 | 青青精品国产自在线拍 | 国产精品免费久久久久影院 | 欧美一区二区在线观看 | 免费国产福利 | 果冻传媒在线播放 免费观看 | 高h肉肉乳共妻 | 青草影院内射中出高潮-百度 | 免费人成在线观看网站视频 | 全黄h全肉细节文在线观看 全黄H全肉细节文短篇 | 水蜜桃亚洲一二三四在线 | 猪蜜蜜网站在线观看电视剧 | 野花日本高清在线观看免费吗 | 99pao成人国产永久免费视频 | 国产精品久久久久无码AV色戒 | 啊灬啊灬啊灬快灬深高潮啦 | 成人做视频免费 | 欧美人妇无码精品久久 | 野花日本大全免费高清完整版 | 亚瑟天堂久久一区二区影院 | 色悠悠电影网 | 亚洲精品一本之道高清乱码 | 亚洲香蕉网久久综合影院 | 免费国产麻豆传 | 免费在线视频a | 国产毛多水多高潮高清 | 理论片在线观看片免费 | 亚洲国产高清视频在线观看 | 久久九九有精品国产23百花影院 | BLACKED太粗太长 |