类属性遍历

<?php
class MyClass{
public $name="John";
public $sex="male";
function test(){
echo "test";
}
}
$obj=new MyClass();
foreach($obj as $key=>$value){
print "obj[$key]=$value\n";
}
?>

    A+
发布日期:2014年07月15日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: