php-凯发k8官方网
引用一个类的属性和方法就使用->符号。->是调用的意思类 -> 类的成员变量或者成员函数
如果得到的结果是对象的话就用-> 名称 来输出内容
如果得到的结果是数组的话就用 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] =>
)
总结
以上是凯发k8官方网为你收集整理的php-箭头r含义,php中-箭头的用法和意义的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: oracle olh hive,hado
- 下一篇: