foreach($Student as $key => $value) StudentArrayList.php
2016-04-08 13:32
519 查看
<!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
James Patt
John Smith
Susan Carter
<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' => 'James Patt ' (length=11) ' name2' => 'John Smith' (length=10) 'name3' => 'Susan Carter' (length=12)
Array
array 0 => ' name1' (length=6) 1 => ' name2' (length=6) 2 => 'name3' (length=5)
array 0 => 'James Patt ' (length=11) 1 => 'John Smith' (length=10) 2 => 'Susan Carter' (length=12)
James Patt
John Smith
Susan Carter
相关文章推荐
- 构造型模式之Builder(生成器)模式
- 如何更改UITextField 的placeholder 的字体颜色
- Android应用的uid和pid
- UICollectionView
- iOS开发之自定义UITableView
- QT:Qt中Ui名字空间以及setupUi函数的原理和实现
- Android UI 优化——使用HierarchyViewer工具
- UnicodeDecodeError: 'gbk' codec can't decode byte 0xfd in position 3952: illegal multibyte sequence
- GPUImage实战问题解决
- GPUImage实战问题解决
- UIImage  切圆形图片方法
- UIButton交互事件-点击button改变label文字
- 外链图2
- datagrid中添加合计行计算合计
- UIImage
- UIButton
- 【LeetCode】62. Unique Paths解法及注释
- java.lang.IllegalArgumentException: Page directive: invalid value for import
- iOS-NSLineBreakMode-lineBreakMode属性详解(UILabel省略号位置)
- requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine("''",))