Blogger Information
Blog 57
fans 0
comment 0
visits 46965
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
数组的创建访问与更新
藍錄的博客
Original
632 people have browsed it

实例

<?php
/**
 * 数组的知识
 */
echo '<h3>数组的创建访问与更新</h3>';
echo '<hr color="green">';

//创建
$city = ['合肥','上海','杭州','南京']; //索引数组
echo $city[0], '<br>';
echo $city[2], '<br>';

// 键值对
$user = ['id'=>10,'name'=>'猪哥','course'=>'php','grade'=>89]; //关联数组
echo $user['name'],'<br>';
echo $user['grade'],'<br>';

//更新
$user['name'] = '朱老师';
echo $user['name'],'<br>';

//删除
//unset($user['grade']);
unset($user);
echo '<pre>',print_r($user,true);

运行实例 »

点击 "运行实例" 按钮查看在线实例

 

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post