PHP生成中文拼音
以下为引用的内容:
php代码:
class ChineseSpell {
/**
* @var array $chineseSpellList 拼音编码对应表
* @access private
*/
private $chineseSpellList = array(
'a'=>-20319,
'ai'=>-20317,
'an'=>-20304,
'ang'=>-20295,
'ao'=>-20292,
'ba'=>-20283,
'bai'=>-20265,
'ban'=>-20257,
'bang'=>-20242,
'bao'=>-20230,
'bei'=>-20051,
'ben'=>-20036,
'beng'=>-20032,
'bi'=>-20026,
'bian'=>-20002,
'biao'=>-19990,
'bie'=>-19986,
'bin'=>-19982,
'bing'=>-19976,
'bo'=>-19805,
'bu'=>-19784,
'ca'=>-19775,
'cai'=>-19774,
'can'=>-19763,
'cang'=>-19756,
'cao'=>-19751,
'ce'=>-19746,
'ceng'=>-19741,
'cha'=>-19739,
'chai'=>-19728,
'chan'=>-19725,
'chang'=>-19715,
'chao'=>-19540,
'che'=>-19531,
'chen'=>-19525,
'cheng'=>-19515,
'chi'=>-19500,
'chong'=>-19484,
'chou'=>-19479,
'chu'=>-19467,
'chuai'=>-19289,
&nb
相关文档:
/*
图片处理类:缩略,裁剪,圆角,倾斜
*/
class resizeimage
{
//图片类型
var $type;
//实际宽度
var $width;
//实际高度
var $height;
//改变后的宽度
var $resiz ......
用php获取本周,上周,本月,上月,本季度日期的代码,主要用到date,strtotime和mktime函数.
echo date("Ymd",strtotime("now")), "
";
echo date("Ymd",strtotime("-1 week Monday")), "
";
echo date("Ymd",strtotime("-1 week Sunday")), "
";
echo date("Ymd",strtotime("+0 week ......
Tag:
-
1.
$query = $this->db->query('SELECT name, title, email from my_table');
foreach ($query->result() as $row)
{
echo $row->title;
echo $row->name;
echo $row->email;
}
2.
foreach ($query->result_array() as $row)
{
echo $row['title'];
echo $row['name'];
ech ......
前一阵试用 tokyo tyrant 碰到一个麻烦,
在php上用memcache接口,取出数据的时候,不会自动反序列化。比如了一个 array(1,2,3,4,5),出来就是 'a:5:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;i:4;i:5;}' 了。
用
Wireshark 跟踪了一下,发现和标准memcached返回的数据里差一个字节。去看了下 memcached
协议,发现这个字节是� ......