惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
T
Threatpost
Latest news
Latest news
N
News | PayPal Newsroom
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
O
OpenAI News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Securelist
小众软件
小众软件
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Martin Fowler
Martin Fowler
S
SegmentFault 最新的问题
Cisco Talos Blog
Cisco Talos Blog
云风的 BLOG
云风的 BLOG
AWS News Blog
AWS News Blog
GbyAI
GbyAI
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
美团技术团队
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
博客园 - 聂微东
V2EX - 技术
V2EX - 技术
T
Troy Hunt's Blog
SecWiki News
SecWiki News
S
Secure Thoughts
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
腾讯CDC
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed

博客园 - 古代

linux下关于重命名卷标 wget header参数使用。 - 古代 - 博客园 奔波尔霸温瑞安 方娥真〈月台〉析论 入凡尘十二年的方娥真 模拟兼容onmouseleave,onmouseenter - 古代 - 博客园 python 进程通信测试代码(程序A,程序B) parse_url 和再pathinfo,what you'll get - 古代 autopos RPM 安装mod_encoding,linux下apache支持中文名 自动杀死pps的后台进程 js表达式转义 - 古代 - 博客园 批量jstest get_top_dom($dom); - 古代 - 博客园 rm大量文件 Read-only file system处理记录 通过PHP获取生僻字的汉语拼音[转] 唉,这个备案,头疼. 神奇的js代码,图片全都飞起来了
php转换拼音,全。
古代 · 2010-03-11 · via 博客园 - 古代

global $pinyindata;
$pinyindata = file_get_contents( dirname(__FILE__).'/WINPY.TXT') ;
function pinyin($str , $type='all')
{
 global $pinyindata;
 $ret = '' ;
 $data = $pinyindata;
 for($i=0;$i<strlen($str);$i++){
   if(ord($str[$i])>0x80){
   $c = $str[$i].$str[++$i];
   $frompos = strpos($data , $c) ;
   if($frompos){
    $topos = strpos($data,"\n",$frompos+strlen($c));
    $start = $frompos+strlen($c);
    $end = $topos-$start;
    $txt = substr($data,$start,$end);
    if($type=='all'){
     $ret .= $txt ;
    }else if($type=='first'){
     $ret .=substr($txt , 0 , 1) ;
    }
   }
   }else{
  $ret .=$str[$i] ;
   }
 }
 return $ret ;
}