国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

? ??? ?? PHP ???? PHP ??? ?? ?? PHP ??? ???? ??? ?? PHP ??? ??? ???

PHP ??? ?? ?? PHP ??? ???? ??? ?? PHP ??? ??? ???

Jul 25, 2016 am 08:57 AM

  1. /**
  2. * ?? ??, ??, ?? ?? '% -()' ??? ??? ???? ?? ?? ??? ?????.
  3. *
  4. * @access public
  5. * @param string $ str ??? ???
  6. *
  7. * @return string $str ??? ???
  8. */
  9. function make_semiangle($str)
  10. {
  11. $arr = ?? ('0' => '0', '1' => '1', '2' => '2', '3' => '3', '4' => '4' ,
  12. '5' => '5', '6' => '7', '8' => '9',
  13. 'A' => 'A', 'C' => 'C', 'E' => 'E',
  14. 'F' => 'G', 'H' => 'J' => 'J',
  15. 'K' => 'L', 'M' => N', 'O' => 'O',
  16. 'P' => 'P', 'Q' => 'R', 'S' = > 'S', 'T' => 'T',
  17. 'U' => 'V', 'W' => X' => 'X', 'Y' => 'Y',
  18. 'Z' => 'Z', 'a' => ', 'c' => 'c', 'd' => 'd',
  19. 'e' => 'e', ??'g' => ; 'g', 'h' => 'i',
  20. 'j' => 'j', 'l ' => 'm' => 'n',
  21. 'o' => 'o', 'p' => , 'q' => 'q', 'r' => 'r', 's' => 't', 'u' => '?', 'v' => 'v', 'w' => 'w', 'x' => 'x',
  22. 'y' => 'y', 'z' => 'z',
  23. '(' => '(', ')' => ')', '〔' => '[', '}' => ']', '【' => '[',
  24. '】' => ']', '〖' => '[', '〗' => ']', '“' => '[', '”' => ']',
  25. ''' => '[', ''' => ']', '{' => '{', '}' => '}', ' 《' => '<',
  26. '》' => '>',
  27. '%' => '%', '+' => '', '—' => '-', '-' => '-', '~' => '-',
  28. ':' => ':', '。' => '.', '、' => ',', ',' => '.', '、' => '.',
  29. ';' => ',', '?' => '?', '!' => '!', '…' => '-', '"' => '|',
  30. '”' => '"', ''' => '`', ''' => '`', '|' => '|', '〃' => '"',
  31. ' ' = > '','$'=>'$','@'=>'@','#'=>'#','^'=>'^','&'=>' &','*'=>'*');
  32. return strtr($str, $arr);
  33. }
復(fù)代代碼
例2,php中文截取字符串

  1. /*
  2. Utf-8, gb2312?支持的漢字截取函數(shù)
  3. cut_str(字符串, 截取??, 開(kāi)始長(zhǎng)道, 編碼);
  4. 編碼默認(rèn)為 utf-8
  5. 開(kāi)始長(zhǎng)島默認(rèn)為 0
  6. * ??: bbs.it-home.org
  7. */
  8. function cut_str($string, $sublen, $start = 0, $code = 'UTF-8') {
  9. if ($code == 'UTF-8') {
  10. $pa = "/[x01-x7f]|[xc2-xdf][x80- xbf]|xe0[xa0-xbf][x80-xbf]|[xe1-xef][x80-xbf][x80-xbf]|xf0[x90-xbf][x80-xbf][x80-xbf]|[xf1 -xf7][x80-xbf][x80-xbf][x80-xbf]/";
  11. preg_match_all( $pa, $string, $t_string );
  12. if (count ( $t_string [0] ) - $start > $sublen)
  13. return Join ( '', array_slice ( $t_string [0], $start, $sublen ) ) . "...";
  14. return Join ( '', array_slice ( $t_string [0], $start, $sublen ) );
  15. } else {
  16. $start = $start * 2;
  17. $sublen = $sublen * 2;
  18. $strlen = strlen( $string );
  19. $tmpstr = '';
  20. for($i = 0; $i < $strlen; $i ) {
  21. if ($i >= $start && $i < ($start $sublen)) {
  22. if (ord ( substr ( $string, $i, 1 ) ) > 129) {
  23. $tmpstr .= substr ( $string, $i, 2 );
  24. } else {
  25. $tmpstr .= substr ( $string, $i, 1 );
  26. }
  27. }
  28. if (ord ( substr ( $string, $i, 1 ) ) > 129)
  29. $i ;
  30. }
  31. if (strlen ( $tmpstr ) < $strlen)
  32. $tmpstr .= "...";
  33. $tmpstr ??;
  34. }
  35. }
  36. $str = "abcd需要截取字符串";
  37. echo cut_str( $str, 1, 0, 'gb2312' );
  38. ?>
???碼

例3,字符串的載取

  1. /**
  2. * 字符截取 支持UTF8/GBK
  3. * @param $string
  4. * @param $length
  5. * @param $dot
  6. */
  7. function str_cut($string, $length, $charset = 'utf-8', $dot = '...') {
  8. $strlen = strlen($string);
  9. if($strlen <= $length) return $string;
  10. $string = str_replace(array(' ',' ', '&', '"', ''', '“', '”', '—', '<', '>', '·', '…'), array('∵',' ', '&', '"', "'", '“', '”', '—', '<', '>', '·', '…'), $string);
  11. $strcut = '';
  12. if(strtolower($charset) == 'utf-8') {
  13. $length = intval($length-strlen($dot)-$length/3);
  14. $n = $tn = $noc = 0;
  15. while($n < strlen($string)) {
  16. $t = ord($string[$n]);
  17. if($t == 9 || $t == 10 || (32 <= $t && $t <= 126)) {
  18. $tn = 1; $n++; $noc++;
  19. } elseif(194 <= $t && $t <= 223) {
  20. $tn = 2; $n += 2; $noc += 2;
  21. } elseif(224 <= $t && $t <= 239) {
  22. $tn = 3; $n += 3; $noc += 2;
  23. } elseif(240 <= $t && $t <= 247) {
  24. $tn = 4; $n += 4; $noc += 2;
  25. } elseif(248 <= $t && $t <= 251) {
  26. $tn = 5; $n += 5; $noc += 2;
  27. } elseif($t == 252 || $t == 253) {
  28. $tn = 6; $n += 6; $noc += 2;
  29. } else {
  30. $n++;
  31. }
  32. if($noc >= $length) {
  33. break;
  34. }
  35. }
  36. if($noc > $length) {
  37. $n -= $tn;
  38. }
  39. $strcut = substr($string, 0, $n);
  40. $strcut = str_replace(array('∵', '&', '"', "'", '“', '”', '—', '<', '>', '·', '…'), array(' ', '&', '"', ''', '“', '”', '—', '<', '>', '·', '…'), $strcut);
  41. } else {
  42. $dotlen = strlen($dot);
  43. $maxi = $length - $dotlen - 1;
  44. $current_str = '';
  45. $search_arr = array('&',' ', '"', "'", '“', '”', '—', '<', '>', '·', '…','∵');
  46. $replace_arr = array('&',' ', '"', ''', '“', '”', '—', '<', '>', '·', '…',' ');
  47. $search_flip = array_flip($search_arr);
  48. for ($i = 0; $i < $maxi; $i++) {
  49. $current_str = ord($string[$i]) > 127 ? $string[$i].$string[++$i] : $string[$i];
  50. if (in_array($current_str, $search_arr)) {
  51. $key = $search_flip[$current_str];
  52. $current_str = str_replace($search_arr[$key], $replace_arr[$key], $current_str);
  53. }
  54. $strcut .= $current_str;
  55. }
  56. }
  57. return $strcut.$dot;
  58. }
復(fù)制代碼

例4,PHP中文字符串翻轉(zhuǎn) 翻轉(zhuǎn)一個(gè)字符串可以使用strrev()函數(shù)即可。 但有時(shí)需要處理是字符串是含中文的,這樣用strrev就會(huì)出現(xiàn)亂碼。 這里自定義一個(gè)函數(shù)來(lái)處理含中文的字符。

  1. /**

  2. * 中文字符串翻轉(zhuǎn)
  3. * by bbs.it-home.org
  4. */
  5. function cstrrev($str)
  6. {
  7. $len = strlen($str);
  8. for($i = 0; $i < $len; $i++)
  9. {
  10. $char = $str{0};
  11. if(ord($char) > 127)
  12. {
  13. $i++;
  14. if($i < $len)
  15. {
  16. $arr[] = substr($str, 0, 2);
  17. $str = substr($str, 2);
  18. }
  19. }
  20. else
  21. {
  22. $arr[] = $char;
  23. $str = substr($str, 1);
  24. }
  25. }
  26. return join(array_reverse($arr));
  27. }

  28. #使用方法:

  29. $str = '中文.look!';
  30. echo cstrrev($str);
  31. #結(jié)果輸出:!kool.文中
復(fù)制代碼

附5,

  1. ?? str_replace_cn($needle, $str, $haystack, $charset = "utf-8"){
  2. $re['utf-8'] = "/[x01-x7f]|[xc2-xdf][x80-xbf]|[xe0-xef][x80-xbf]{2}|[xf0-xff][x80 -xbf]{3}/";
  3. $re['gb2312'] = "/[x01-x7f]|[xb0-xf7][xa0-xfe]/";
  4. $re['gbk'] = "/[x01-x7f]|[x81-xfe][x40-xfe]/";
  5. $re['big5'] = "/[x01-x7f]|[x81-xfe]([x40-x7e]|xa1-xfe])/";
  6. preg_match_all($re[$charset], $haystack, $match_haystack);
  7. preg_match_all($re[$charset], $needle, $match_needle);
  8. for($i = 0; $i if(!in_array($match_needle[0][$i], $match_haystack[0] ))return $haystack;//無(wú)匹配
  9. }
  10. $match_haystack = $match_haystack[0];
  11. $match_needle = $match_needle[0];
  12. for($i = 0; $i < count($match_haystack); $i ){
  13. if($match_haystack[$i] == "")continue;
  14. if($match_haystack[$i] == $match_needle[0]){
  15. if(count($match_needle) == 1){//如果只一個(gè)字符
  16. $match_haystack[$i] = $str;
  17. }else{
  18. $flag = true;
  19. for($j = 1; $j if($match_haystack[$i $j] != $match_needle[$j]){
  20. $??? = ??;
  21. ??;
  22. }
  23. }
  24. if($flag){//匹配
  25. $match_haystack[$i] = $str;
  26. for($j = 1; $j $match_haystack[$i $j] = "";
  27. }
  28. }
  29. }
  30. }
  31. }
  32. return implode("", $match_haystack);
  33. }
復(fù)代碼


? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1601
29
PHP ????
1502
276
???
PHP ?? ??? ??????? PHP ?? ??? ??????? Jul 17, 2025 am 04:16 AM

PHP ?? ??? ?? ???? ?? ? ????? ??? ?????. 1. ?? ??? ??? ??? ??? ? ? ??? ??? ??? ?? ?? ??? ???? ???????. 2. ?? ??? ???? ???? ? ?? ????? ?? ?? ?? ??? ?????. 3. $ _get ? $ _post? ?? Hyperglobal ??? ?? ???? ?? ??? ? ??? ??? ??????? ???????. 4. ?? ?? ?? ???? ?? ?? ?? ??? ?????? ?? ??? ??? ?? ??? ???????. ??? ??? ????? ??? ??? ?? ???? ????? ? ??? ? ? ????.

PHP?? ?? ???? ???? ???? ??? ?????? PHP?? ?? ???? ???? ???? ??? ?????? Jul 08, 2025 am 02:37 AM

PHP ?? ???? ???? ????? ?? ? ??? ???? ?? ?? ? ??? ???? ?? ??? ?????? ??? ??? ? ? ???????. 1. ??? ?? CSRF? ???? ?? ??? ??? ???? ?????? ??? ???? FINFO_FILE? ?? ?? MIME ??? ?????. 2. ??? ??? ??? ???? ??? ?? ??? ?? ? WEB ????? ??? ???? ??????. 3. PHP ?? ??? ?? ? ?? ???? NGINX/APACHE? ??? ????? ?? ???? ?????. 4. GD ?????? ??? ? ?? ???? ??? ?? ??? ?? ????.

PHP?? ?? ?? PHP?? ?? ?? Jul 18, 2025 am 04:57 AM

PHP ?? ???? ? ?? ???? ??? ????. 1. // ?? #? ???? ? ?? ??? ???? // ???? ?? ????. 2. ?? /.../ ?? ?? ?? ??? ????? ?? ? ?? ??? ?? ? ? ????. 3. ?? ?? ?? / if () {} /? ?? ?? ??? ????? ??? ?? ?? ?? ??? ???? ????? ???? ??? ?? ???? ???? ??? ? ??? ??????.

PHP ?? ?? ? PHP ?? ?? ? Jul 18, 2025 am 04:51 AM

PHP ??? ???? ??? ??? ??? ????? ????. ??? ????? ?? ???? ??? "?? ? ?"??? "?"? ???????. 1. ??? ? ??? ??? DocBlock (/*/)? ?? ?? ??? ???? ??? ? ?? ???? ??????. 2. JS ??? ???? ?? ???? ??? ?? ??? ??? ?????. 3. ??? ?? ?? ?? ??? ???? ????? ????? ???? ?? ????? ???? ? ??????. 4. Todo ? Fixme? ????? ???? ? ? ??? ??? ???? ?? ?? ? ??? ???????. ??? ???? ?? ??? ??? ?? ?? ?? ???? ???? ? ????.

PHP?? ???? ??? ?????? PHP?? ???? ??? ?????? Jul 11, 2025 am 03:12 AM

Ageneratorinphpisamemory- ???? Way-Erate-Overgedatasetsetsbaluesoneatimeatimeatimeatimallatonce.1.generatorsuseTheyieldKeywordTocroadtOpvaluesondemand, RetingMemoryUsage.2

?? PHP : ??? ??? ?? PHP : ??? ??? Jul 18, 2025 am 04:54 AM

tolearnpheffectical, startBysetTupaloCalserErverEnmentUsingToolslikexamppandacodeeditor -likevscode.1) installxamppforapache, mysql, andphp.2) useacodeeditorforsyntaxsupport.3)) 3) testimplephpfile.next, withpluclucincludechlucincluclucludechluclucled

PHP?? ??? ? ???? ??? ????? ?? PHP?? ??? ? ???? ??? ????? ?? Jul 12, 2025 am 03:15 AM

PHP??? ???? ??? ?? ?? ????? ???? ??? ?? ??? ??? ?? ? ??? ??? ???? ?????. ???? 0?? ???? ?? ??? ???? ? ?? ???? ?? ?? ? ? ????. MB_SUBSTR? ?? ??? ??? ???????. ? : $ str = "hello"; echo $ str [0]; ?? H; ??? MB_SUBSTR ($ str, 1,1)? ?? ??? ??? ??? ??????. ?? ???????? ???? ??? ???? ?? ???? ?? ?? ???? ?????? ??? ????? ?? ??? ?? ??? ???? ???? ?? ????.

?? PHP ?? ??? ?? PHP ?? ??? Jul 18, 2025 am 04:52 AM

toinstallphpquickly, usexampponwindowsorhomebrewonmacos.1. ??, downloadandinstallxAmpp, selectComponents, startApache ? placefilesinhtdocs.2

See all articles