~~~
<?php
function getFirstChar($s0){
$fchar = ord($s0{0});
if($fchar >= ord("A") and $fchar <= ord("z") )return strtoupper($s0{0});
$s1 = iconv("UTF-8","gb2312", $s0);
$s2 = iconv("gb2312","UTF-8", $s1);
if($s2 == $s0){$s = $s1;}else{$s = $s0;}
$asc = ord($s{0}) * 256 + ord($s{1}) - 65536;
if($asc >= -20319 and $asc <= -20284) return "A";
if($asc >= -20283 and $asc <= -19776) return "B";
if($asc >= -19775 and $asc <= -19219) return "C";
if($asc >= -19218 and $asc <= -18711) return "D";
if($asc >= -18710 and $asc <= -18527) return "E";
if($asc >= -18526 and $asc <= -18240) return "F";
if($asc >= -18239 and $asc <= -17923) return "G";
if($asc >= -17922 and $asc <= -17418) return "I";
if($asc >= -17417 and $asc <= -16475) return "J";
if($asc >= -16474 and $asc <= -16213) return "K";
if($asc >= -16212 and $asc <= -15641) return "L";
if($asc >= -15640 and $asc <= -15166) return "M";
if($asc >= -15165 and $asc <= -14923) return "N";
if($asc >= -14922 and $asc <= -14915) return "O";
if($asc >= -14914 and $asc <= -14631) return "P";
if($asc >= -14630 and $asc <= -14150) return "Q";
if($asc >= -14149 and $asc <= -14091) return "R";
if($asc >= -14090 and $asc <= -13319) return "S";
if($asc >= -13318 and $asc <= -12839) return "T";
if($asc >= -12838 and $asc <= -12557) return "W";
if($asc >= -12556 and $asc <= -11848) return "X";
if($asc >= -11847 and $asc <= -11056) return "Y";
if($asc >= -11055 and $asc <= -10247) return "Z";
return null;
}
function chinesePhoneticize($zh){
$ret = "";
$s1 = iconv("UTF-8","gb2312", $zh);
$s2 = iconv("gb2312","UTF-8", $s1);
if($s2 == $zh){$zh = $s1;}
for($i = 0; $i < strlen($zh); $i++){
$s1 = substr($zh,$i,1);
$p = ord($s1);
if($p > 160){
$s2 = substr($zh,$i++,2);
$ret .= getfirstchar($s2);
}else{
$ret .= $s1;
}
}
return $ret;
}
echo "這是中文字符串<br/>";
echo pinyin1('這是中文字符串');
~~~
- PHP新特性
- 一些常識
- PHP常見header頭
- Nginx配置文件
- 常用工具類
- PHP實現的一個時間幫助類
- PHP原生生成EXCEL
- PHP地理位置計算
- PHP獲取服務器狀態
- 駝峰轉下劃線
- 百度地圖兩點坐標距離計算
- 判斷是否是url
- 郵件發送類
- 阿拉伯數字轉化為大寫
- 獲取漢字首個拼音
- 根據身份證號獲取星座
- 生成驗證碼類
- 生成唯一ID
- 身份證驗證類
- PHP中文轉拼音
- curl獲取網頁內容
- 快遞查詢api
- 快遞API類
- 上傳圖片類
- 股票類
- 找回密碼類
- 校驗數據規則
- PHP獲取收集相關信息
- 字符串截取助手函數
- 網頁中提取關鍵字
- 檢測瀏覽器語言
- PHP實現微信紅包拆分算法
- 常用函數
- 微信相關
- 網絡知識
- LX1 Laravel / PHP 擴展包視頻教程
- THINKPHP5學習
- 高級查詢
- Vue學習
- Vue全家桶
- Vue-CLI 3.x 自動部署項目至服務器
- Vue2全家桶
- Vue2全家桶之一:vue-cli(vue腳手架)超詳細教程
- Vue2全家桶之二:vue-router(路由)詳細教程,看這個就夠了
- Vue2全家桶之三:vue-resource(不推薦)----axios(推薦)
- 前端相關
- sublime text3 配置less編譯環境
- 服務器搭建相關
- supervisor
- Supervisor 安裝與配置 Linux進程管理
- supervisor 永不掛掉的進程 安裝以及使用
- Supervisor進程管理&開機自啟
- php實現定時任務
- 使用sublime text3 連接sftp/ftp(遠程服務器)
- Redis相關
- linux服務器重啟后導致redis數據丟失
- 搜索引擎SEO
- 百度收錄權威鏈接,指向真正需要收錄的地址rel
- 軟件相關
- sublime
- sublime Text3修改側邊欄的主題
- sublime和vscode比較
- Acrylic DNS Proxy 使用方法
- 技術類網址收藏