Blogger Information
Blog 22
fans 0
comment 0
visits 11501
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
字符串学习
没耐心的渔翁
Original
588 people have browsed it
  1. //str_repeat — 重复一个字符串
  2. $str='admin';
  3. echo str_repeat($str , 10);
  4. echo '<hr>';
  5. //随机打乱一个字符串
  6. $str = "0~99";
  7. $shuffled = str_shuffle($str);
  8. echo $shuffled;
  9. echo '<hr>';
  10. //str_split 字符串转数组
  11. $str = "Hello Friend";
  12. $arr1 = str_split($str);
  13. //可以选择数组转换的长度 默认是1;
  14. //str_split(字符串, 返回数组的的长度)
  15. $arr2 = str_split($str, 5);
  16. printf('<pre>%s</pre>',print_r($arr1,true));
  17. printf('<pre>%s</pre>',print_r($arr2,true));
  18. //md5 加密为32位
  19. $str='1223456';
  20. echo md5($str).'<br>';
  21. echo '加密位数:'. strlen(md5($str));
  22. echo '<hr>';
  23. //sha1 加密为40位
  24. $str='1223456';
  25. echo sha1($str).'<br>';
  26. echo '加密位数:' .strlen(sha1($str));

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