Correcting teacher:天蓬老师
Correction status:qualified
Teacher's comments:本质并无区别的
— php与javasript的遍历区别
<?php
$cars=['1宝马3GT xDrive 330li 耀石灰','2宝马x2 xDrive20i x','3宝马x5 xDrive30i x','4宝马750i 小drive V8m'];
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<h2><?php echo '宝马轿跑BWM车' ?></h2>
<ol>
<!--使用PHP模板语法 : 代表{ -->
<? foreach($cars as $car):?>
<li style='color:green'>
<a href=''><? echo $car ;?></a>
</li>
<?endforeach?>
</ol>
<script type="text/javascript">
let cars=['1.宝马3GT xDrive 330li 耀石灰','2.宝马x4 xDrive6i x','3.宝马x5 xDrive30i x','4.宝马750i 小drive V8 m'];
for (let i=0;i< cars.length;i++){
alert(cars[i]);
}
</script>
</body>
</html>
<?php
$user='pater';
$password=md5('123456');
echo $password;
$password1=md5('123456');
echo $password1;
echo $user;
var_dump($user);