实例
<?php // foreach循环练习 $arr=array( array('name'=>'1fugui','age'=>133,'add'=>'1hefei','herf'=>'1It程序'), array('name'=>'2roonghua','age'=>233,'add'=>'2hefei','herf'=>'2It程序'), array('name'=>'3zixing','age'=>333,'add'=>'3hefei','herf'=>'3It程序'), array('name'=>'4wdqw','age'=>433,'add'=>'4hefei','herf'=>'4It程序'), ); foreach ($arr as $key => $value) { if ($value['herf']=='3It程序') { echo "姓名:".$value['name']; } } echo "<br>"; $data=''; foreach ($arr as $key2 => $value2) { $data .= "姓名:name"."=".$value2['herf']."<br>"; } echo $data; ?>
运行实例 »
点击 "运行实例" 按钮查看在线实例
实例
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>员工管理系统</title> <style> *{padding: 0;margin: 0} li{list-style: none;text-decoration: none;} a{text-decoration: none;cursor: pointer;color: #EBEDEF} .box{width: 100%} .head{width: 100%;height: 55px;background-color: #EBEDEF;line-height: 55px;font-size: 20px;} .head span{display: inline-block;width: 20%;background-color: #999;text-align: center;color: #fff;font-weight: bold;} .left{width: 20%;background-color:#999;height: 900px;float: left; } .left a{width: 100%;display: inline-block;text-align: center;padding: 10px 0} .left a:hover{background-color: #333;color: red;font-weight: bolder;} .right{width: 80%;float: left; } iframe{border: none;} </style> </head> <body> <div class="box"> <div class="head"><span>员工管理系统</span>其他 </div> <div class="left"> <a href="index.php" target="workface">首页</a> <a href="user.php" target="workface">人员管理</a> <a href="zhiwei.php" target="workface">职位管理</a> <a href="data.php" target="workface">数据中心</a> <a href="system.php" target="workface">系统配置</a> </div> <div class="right"> <iframe src="index.php" name="workface" width="100%"></iframe> </div> </div> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例