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

推荐订阅源

博客园 - 叶小钗
云风的 BLOG
云风的 BLOG
G
Google Developers Blog
S
SegmentFault 最新的问题
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
DataBreaches.Net
F
Fortinet All Blogs
TaoSecurity Blog
TaoSecurity Blog
D
Docker
C
Cybersecurity and Infrastructure Security Agency CISA
K
Kaspersky official blog
宝玉的分享
宝玉的分享
腾讯CDC
Google Online Security Blog
Google Online Security Blog
Recorded Future
Recorded Future
T
The Exploit Database - CXSecurity.com
T
The Blog of Author Tim Ferriss
V
V2EX
S
Securelist
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
CERT Recently Published Vulnerability Notes
A
Arctic Wolf
Scott Helme
Scott Helme
L
LINUX DO - 热门话题
Y
Y Combinator Blog
P
Proofpoint News Feed
T
Tor Project blog
AWS News Blog
AWS News Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
博客园 - 聂微东
T
Threat Research - Cisco Blogs
B
Blog
Attack and Defense Labs
Attack and Defense Labs
L
Lohrmann on Cybersecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
阮一峰的网络日志
阮一峰的网络日志
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
N
News and Events Feed by Topic
博客园 - 司徒正美
H
Help Net Security
C
Cisco Blogs
C
Check Point Blog
S
Secure Thoughts

博客园 - 古代

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 ;
}