插件9:去掉重音符号

<?php // Plug-in 9: Remove Accents

// This is an executable example with additional code supplied
// To obtain just the plug-ins please click on the Download link

$text = "带有重音符号的文本"

echo "$text<br /><br />";
echo PIPHP_RemoveAccents($text);

function PIPHP_RemoveAccents($text)
{
   // Plug-in 9: Remove Accents
   //
   // This plug-in takes a string variable containing any
   // text and then replaces any accented characters with
   // their non-accented equivalents. The arguments required
   // are:
   //
   //    $text: Text to be modified

   $from = array("重音符号1","重音符号2","重音符号3");

   $to =   array("对应非重音符号1","对应非重音符号2","对应非重音符号3");
                 
   return str_replace($from, $to, $text);
}

?>

插件说明:

插件9输入包含重音符的字符串,返回转换后的字符串。他要求以下参数:

$text 字符串变量,包含需要转换的文本。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值