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’);

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.