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] =>
)
總結
以上是生活随笔為你收集整理的php-箭头r含义,php中-箭头的用法和意义的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oracle+olh+hive,hado
- 下一篇: linux日志文件存放目录,Log4j