<?php $_bool = true; echo gettype($_bool); $_string = (string)$_bool; echo "<BR><BR>"; echo gettype($_string); echo "<BR><BR>"; echo (int) ( (0.1+0.7) * 10 ); //定界符 echo "<BR><BR>"; $str = <<<END 大家好, 定界符出来了, 谢谢!妈的你好意思,现在才看这块! END; class foo { var $foo; var $bar; function foo() { $this->foo = 'Foo'; $this->bar = array('Bar1', 'Bar2', 'Bar3'); } } $foo = new foo(); $name = 'MyName'; echo <<<END fooclass Name ".$name.", is bar:".{$foo->bar[1]}; END; echo "<BR><BR>"; $a="Hello A"; $b="a"; echo "This is a {${$b}}"; //理解正确,操蛋现在才看这些 echo "<BR><BR>"; echo $a{0}; echo "<BR><BR>"; $_foo = array(1=>"xxdxxd", 2=>"xxdxxd2"); settype($_foo, "object"); var_dump($_foo); //object(stdClass)#1 (2) { [1]=> string(6) "xxdxxd" [2]=> string(7) "xxdxxd2" } echo "<BR><BR>"; echo get_class($foo)."<BR>"; echo get_parent_class($foo)."<BR>"; $subclass = is_subclass_of($foo, "base"); var_dump($subclass); //echo $foo->1; //$stdClass->1; echo "<BR><BR>"; //get_resource_type $c = mysql_connect("localhost", "root",""); echo get_resource_type($c)."<BR>"; $fp = fopen("foo", "w"); echo get_resource_type($fp)."<BR>"; //$doc = new_xmldoc("1.0"); ?>