代码是上面这样的
结果成这样的,我知道?的位置应该是'*'这个前缀,但是怎么样能让它正常显示呢
header头:
浏览器编码:
后来用Print_r试了下 可以正常使用:
Array ( [intpub] => 123 [pub] => public [*pro] => protected [objpri] => private )
但是这是为什么吗呢?求指导
Reply content: !--? php//header ("content_type:text/html ; Charset=utf-8 "), class obj{public $intpub = 123; Public $pub = ' public '; Protected $pro = ' protected '; Private $pri = ' private '; Const con= ' const '; Public Function Thefunc () {return ' Func '; }} $obj =new obj (); Var_dump ((array) $obj);//
code is the
result like this, I know? should be the ' * ' prefix, but how can it be displayed correctly
Header:
Browser code:
later tested with Print_r:
Array ([intpub] = 123 [Pub] = public [*pro] = protected [OBJPRI] + private )
But why is that? For guidance
Vardump Normal print out is public, The garbled ones are those that are not public.
This problem I have not met, after all, through the actual class directly print properties is not necessary, can be put into the method to print it out.
BTW, programming to result-oriented bar, this kind of more strange problems can be recorded, later to see or ask a master.