foreach($Student as $key => $value) StudentArrayList.php
来源:互联网 发布:淘宝网爱康多大药房 编辑:程序博客网 时间:2024/06/06 18:23
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> StudentArrayList.php </title>
<meta charset="UTF-8">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<body>
<form method="post" action="">
<input type="text" name="usrname"><br>
<input type="submit">
</form>
<br>usrname:<br>
<?php
$Student = array(" name1" =>"James Patt " , " name2" =>"John Smith" , "name3"=>"Susan Carter");
var_dump($Student);
Echo($Student);
//List($key_name,$val) = $Student;//echo($Student);
//Echo("$key_name");
//Echo("$val");
//foreach($Item in $Student )
foreach($Student as $key => $value)
{
$key_name[]= $key;//$Item.Key;
$val[]= $value;//$Item.value;
}
var_dump($key_name);
var_dump($val);
foreach($Student as $value)
{
echo $value . '<br>';
}
?>
</body>
</html>
usrname:
array ' name1' => string 'James Patt ' (length=11) ' name2' => string 'John Smith' (length=10) 'name3' => string 'Susan Carter' (length=12)
Array
array 0 => string ' name1' (length=6) 1 => string ' name2' (length=6) 2 => string 'name3' (length=5)
array 0 => string 'James Patt ' (length=11) 1 => string 'John Smith' (length=10) 2 => string 'Susan Carter' (length=12)
James Patt
John Smith
Susan Carter
- foreach($Student as $key => $value) StudentArrayList.php
- PHP foreach的两种用法 as $key => $value
- PHP foreach的两种用法 as $key => $value
- PHP foreach的两种用法 as $key => $value
- PHP foreach的两种用法 as $key => $value
- foreach($arr as $key=>$value);foreach($arr as $value);
- 用python遍历列表,同时输出索引号和值,类似php的foreach(array_expression as $key => $value)
- $arr as $key=>$value解释
- 对php中在foreach中使用foreach ($arr as &$value) 这种类型的解释
- C# Hashtable初始化,foreach、Add、ht[key]=value、Remove()、Contain()、clear()
- thinkphp(2) foreach($arr as &$value)用法 记录一下
- smarty-foreach-key-value-index-iteration最全用法
- Mybatis foreach嵌套遍历Map的key和value
- mybatis foreach循环遍历map中的key和value
- php foreach循环语句的&$value与$value辨析;
- php实现简单key-value hash数据库
- phpredis:php一个key-value用法
- php关联数组通过key获取value
- Neo4j 的一些使用心得
- 安装React Native
- 【蓝桥杯】【入门训练3题】
- 构造型模式之Builder(生成器)模式
- 这些小工具让你的Android 开发更高效
- foreach($Student as $key => $value) StudentArrayList.php
- 图的基本算法(单源最短路径)
- 网络下载+刷新
- Wireshark OS X can't detect interface
- navicat 连接远程mysql
- 两分钟上传代码到github
- IIS7报错处理
- Bootstrap模态框及获取checkbox选中的个数
- C/C++ typedef 用法小结