Blogger Information
Blog 14
fans 0
comment 0
visits 9562
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
PHP 第一课 foreach get和post
耿玉洁的博客
Original
853 people have browsed it

PHP 语法 <?php ?>

创建变量 :  $变量名称 =

遍历: foreach ($数组变量 as $vaule){   echo $key+1 . ': ' . $value . '<br>';}     echo输入部分 加号用 . 代替

也可以是 foreach( $数组变量 as $key=> $vaule){}

foreache的代替语法:  <?php foreache($数组变量 as $vaule): ?> <?php endforeach?> 用”:“代替大括号,并添加

 <?php endforeach?>标签

 

php 中 get 和 post 数据处理 使用 $_GET 或着 $_POST

 $_GET 或着 $_POST  都是数组

<?php print_r ($_GET) ?>

用IF条件判断

if (isset($_GET['email'])) {
//    echo $_GET['email'];
//} else {  // 给个默认值
//    $_GET['email'] = '';

三元运算符进行简化

echo isset($_GET['email']) ? $_GET['email'] : '';

 

Correction status:qualified

Teacher's comments:作业有点敷衍了, 下次要认真写
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