Home  >  Article  >  Backend Development  >  php函数大全

php函数大全

WBOY
WBOYOriginal
2016-06-23 14:31:331007browse

 strtoupper($string);//全部换成大写

strtolower($string);//全部换成小写

ucwords($string);//单词的首字母换成大写

strrpos()函数查找字符串在另一个字符串中最后一次出现的位置。[string,]

PHP的数据类型转换属于强制转换,允许转换的PHP数据类型有:

(int)、(integer):转换成整形 (float)、(double)、(real):转换成浮点型 (string):转换成字符串 (bool)、(boolean):转换成布尔类型 (array):转换成数组 (object):转换成对象

PHP数据类型有三种转换方式:

在要转换的变量之前加上用括号括起来的目标类型 使用3个具体类型的转换函数,intval()、floatval()、strval() 使用通用类型转换函数settype(mixed var,string type)

 第一种转换方式: (int)  (bool)  (float)  (string)  (array) (object)

  

第二种转换方式:  intval()  floatval()  strval()

  

第三种转换方式:  settype();

 



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