Blogger Information
Blog 87
fans 1
comment 0
visits 58491
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
字符串函数学习
阿杰
Original
548 people have browsed it

字符串函数

1、md5() 加密

  1. // md5加密
  2. $password = '123456';
  3. echo md5($password);

2、strtoupper() 字符串转大写

  1. // strtoupper 字符串转大写
  2. $str1 = 'abcdefghijklmn';
  3. echo strtoupper($str1).'<hr>';

3、strtolower() 字符串转小写

  1. // strtolower 字符串转小写
  2. $str2 = 'JKDHJKSDHFJKSJDFH';
  3. echo strtolower($str2).'<hr>';

4、 str_ireplace() 替换指定字符串(不区分大小写)

  1. // str_ireplace 替换指定字符串(不区分大小写)
  2. $str3 = '你好呀A省,a市,a区';
  3. echo str_ireplace("A","B",$str3).'<hr>';

5、str_word_count() 计算字符串的单词数量

  1. // str_word_count 计算字符串的单词数量
  2. $str4 = '你好hello加点water';
  3. echo str_word_count($str4).'<hr>';

Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post