Home  >  Article  >  Backend Development  >  java软件工程师学php - 4. gettype()/settype()

java软件工程师学php - 4. gettype()/settype()

WBOY
WBOYOriginal
2016-06-13 13:11:001056browse

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn