Blogger Information
Blog 34
fans 0
comment 0
visits 39191
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
php基础——线上培训5期——19-3-18
黄健的博客
Original
746 people have browsed it

今天的课程:php基础

    1 php环境搭建:php工具箱

    2 变量与常量

        变量:不能以数字开头,大小写敏感,不允许中文,变量的写法,小驼峰与大驼峰写法;$userName, $UserName

                销毁变量: unset( $userName )

        常量: define('PATH ',' www.php.cn ') 不变的量,推荐大写

    3 数组:索引数组与关联数组

            索引: $arr = array( 0,1,2,3 )

            关联数组:$arr=array( 'one'=>1 , ' two '=>2 ); 键值对

  4 注释: 多行与单行  

            多行:/* 注释内容 */

            单行: //

5 数据类型:标量类型;复合类型;特殊类型

        标量类型:string, int ,float, boolean ;  例:$flag = true;

        复合类型: array;  $arr=array(); 

        特殊类型:null

6 循环语句: for, while , do while, foreach

        for: 需要三个条件,初始值,循环判断,值累加

            for( $i=0 ; $i < 10 ;$i++ ){  //循环0-9 }

        while: 一个条件;判断为假时中断

             $i=5;        while( $i <10){ $i++ }

        do while:至少循环一次

           $i = -1 ; do{ $i ++} while( $i >0 )

        foreach(): 用于数组循环:循环值,与键值对

            循环值:foreach( $arr as $v ){  echo $v; }

            循环键值:foreach( $arr as $k => $v ) { echo $k . '---' . $v }



Correction status:Uncorrected

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