亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Introduction aux tableaux multidimensionnels pour débutants PHP

php Tableau multidimensionnel

Les valeurs d'un tableau peuvent être un autre tableau, et la valeur d'un autre tableau peut également être un tableau. De cette fa?on, nous pouvons créer un tableau bidimensionnel ou tridimensionnel?:

Créer un tableau bidimensionnel

Format?:

tableau (

tableau(1,2,3,4,5),

tableau(6,7,8,9,10)

)

Exemple 1?:

<?php
	$arr = array(
			array(1,2,3,4,5),
			array(6,7,8,9,10)
		);

	echo "<pre>";
	print_r($arr);
	echo "</pre>";
?>

Exemple 2?: Créer un tableau multidimensionnel

<?php 
header("Content-type: text/html; charset=utf-8");//設(shè)置編碼 
$sites = array ( 
        "php"=>array ( 
            "php中文網(wǎng)", 
            "http://ipnx.cn" 
        ), 

        "google"=>array ( 
            "Google 搜索", 
            "http://www.google.com" 
        ), 

        "taobao"=>array( 
            "淘寶", 
            "http://www.taobao.com" 
        ) 
); 
print("<pre>"); // 格式化輸出數(shù)組 
print_r($sites); 
print("</pre>"); 
?>

Un tableau multidimensionnel est un tableau contenant un ou plusieurs tableaux.

Dans les tableaux multidimensionnels, chaque élément du tableau principal peut également être un tableau, et chaque élément du sous-tableau peut également être un tableau


Formation continue
||
<?php echo "hello world"; ?>
soumettreRéinitialiser le code