php-箭头r含义,php中-箭头的用法和意义

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

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

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

程序:while ($property = mysql_fetch_field($row))

{

print_r($property);

echo "Field name: " . $property->name . "
";

}

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] =>

)


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部