zoukankan      html  css  js  c++  java
  • php中>箭头的用法和意义

    引用一个类的属性和方法就使用->符号。
    ->是调用的意思
    类 -> 类的成员变量或者成员函数

     

    如果得到的结果是对象的话就用-> 名称 来输出内容

    如果得到的结果是数组的话就用 myarray[] 来输出

    程序:
    while ($property = mysql_fetch_field($row))
    {
     print_r($property);
    echo "Field name: " . $property->name . "<br />";
    }


    while($rs=mysql_fetch_array($row)){
     echo $rs[0];
     print_r($rs);
    }

    执行结果:

    stdClass Object
    (
        [name] => id
        [table] => list
        [def] => 
        [max_length] => 7
        [not_null] => 1
        [primary_key] => 1
        [multiple_key] => 0
        [unique_key] => 0
        [numeric] => 0
        [blob] => 0
        [type] => string
        [unsigned] => 0
        [zerofill] => 0
    )
    stdClass Object
    (
        [name] => content
        [table] => list
        [def] => 
        [max_length] => 6
        [not_null] => 0
        [primary_key] => 0
        [multiple_key] => 0
        [unique_key] => 0
        [numeric] => 0
        [blob] => 1
        [type] => blob
        [unsigned] => 0
        [zerofill] => 0
    )

    Array
    (
        [0] => 35list1
        [id] => 35list1
        [1] => 测试
        [content] => 测试
        [2] => 
        [writedate] => 
    )
    Array
    (
        [0] => abck
        [id] => abck
        [1] => 中国
        [content] => 中国
        [2] => 
        [writedate] => 
    )

  • 相关阅读:
    奇异值分解SVD
    Google Draco点云压缩
    C++计时函数
    NDT正态分布变换配准
    点云配准 Registration
    图像的距
    镜头基础
    道格拉斯-普克算法
    霍夫变换
    opencv基础
  • 原文地址:https://www.cnblogs.com/losesea/p/3014213.html
Copyright © 2011-2022 走看看