Home > Backend Development > PHP Tutorial > 这种符号各表示啥意思

这种符号各表示啥意思

WBOY
Release: 2016-06-23 14:39:00
Original
1223 people have browsed it

<?php    $mysqli=new mysqli("localhost","root","","xsphpdb");    $stmt=$mysqli->stmt_init();    var_dump($stmt);    $mysqli->close();
Copy after login

结果是:
object(mysqli_stmt) #2  (0)  { } 

其中的#2是啥意思  0又是啥意思,还有后面的花括号


回复讨论(解决方案)

object(mysqli_stmt)#2 (0) { } 
表示
object(mysqli_stmt) 这是一个 mysqli_stmt 对象
#2 是 mysqli 对象系列的第二个($mysqli 是第一个)
(0) 成员个数为 0 (只开列属性)
{ } 所以是空集合

即然是对象系列,那么可以理解为一个数组吗?如果是数组,那么用print_r()能打印出来吗,俺刚学,有的地方反应不过来,见谅。

对象和数组不同的数据结构
输出方式 对象 $m->name 数组$m['name']

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template