Home > Backend Development > PHP Tutorial > 请教上, php里echo里的row,好像没办法写字段名

请教上, php里echo里的row,好像没办法写字段名

WBOY
Release: 2016-06-13 12:54:15
Original
781 people have browsed it

请问下, php里echo里的row,好像没办法写字段名?
echo "$row[1] 请教上, php里echo里的row,好像没办法写字段名 ";


上文是可以正常工作的. 如果我改成$row->icontext 这一类的写法.就不行了.

请高手指点一下,谢谢.


------解决方案--------------------
当然不行!
$row[3] 是数组 $row 下标3的内容
$row->icontext 是对象 $row 的 icontext 属性

虽然 php 是弱类型,但也没有弱到不需要区分数组和对象
------解决方案--------------------
想用对象就用fetch_object方法
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