知识点 总结

1  user focus()      验证错误 光标弹回input标签。

    面向对象 

2 function_construct ( )    初始化函数

3 private : 只能在类使用 。

4  public $classname = " fg19"

            公开的 变量

5 public function getmyclass(){

           echo  " 班级名 ",$this → classname;

           注 :$this → classname;  类的本身去调用它

   }
 6  <?php 

              include ();   调用

             $class = new myclass();    必须与类名一样

              $class → classname ="fg18";

                                                 给class赋值

                $class    → getmyclass();

7 array-shift()  先进先出

    注 array_shift将数组开头的单元移出数组 

    array_shift() array 的第一个单元移出并作为结果返回,将 array 的长度减一并将所有其它单元向前移动一位。所有的数字键名将改为从零开始计数,文字键名将不变

   7.1 

      

Example #1 array_shift() 例子

<?php
$stack 
= array( "orange" "banana" "apple" "raspberry" );
$fruit  array_shift ( $stack );
print_r ( $stack );
?>

以上例程会输出:

Array
(
    [0] => banana
    [1] => apple
    [2] => raspberry
)

并且 orange 被赋给了 $fruit 。 

7.2     array- pop

       array_pop将数组最后一个单元弹出(出栈)

          array_pop() 弹出并返回 array 数组的最后一个单元,并将数组 array 的长度减一。如果 array 为空(或者不是数组)将返回 NULL 。 Will additionally produce a Warning when called on a non-array.    

         7.2.1

           

Example #1 array_pop() 例子

<?php
$stack 
= array( "orange" "banana" "apple" "raspberry" );
$fruit  array_pop ( $stack );
print_r ( $stack );
?>

经过此操作后, $stack 将只有 3 个单元:

Array
(
    [0] => orange
    [1] => banana
    [2] => apple
)

并且 rasberry 将被赋给 $fruit 。 

8  explode("",$sql)[0]  这种写法在php5.4是不支持的

      explode("",$sql) 数组

         [0] 第几个

原文地址:https://www.cnblogs.com/cd-snoopy/p/3734443.html