Month: August 2011

java程序员学php – 8. 神奇的extract()

声明这样一个关联数组:   $map[‘BJ’] = ‘Beijing’;   $map[‘SH’] = ‘Shanghai’; 然后做一下extract($map), 你就可以自动获得 $BJ 和 $SH这两个变量,它们的值分别为Beijing和Shanghi。 也就是说,extract替你编程了。这在Java语言里还是很难想象的。

java程序员学php – 4. gettype()/settype()

1.gettype()拿到数据类型   比如 gettype(345); //返回"integer"       gettype(some_object);// 返回"object"   另有一些快捷的类型查询函数,如 is_double(), is_array(), is_string()等 2.settype()则强行改变数据的类型    settype($a, ‘double’);

动/静态类型和强/弱类型

摘自"Dive into Python" statically typed language     A language in which types are fixed at compile time. Most statically typed languages enforce this by requiring you to declare all variables with their datatypes before using them. Java and C are statically typed languages. dynamically typed language     A language in which types are discovered at …

动/静态类型和强/弱类型 Read More »