忆风居

忆风的地盘,一些日常的记忆,技术文摘,以及收集的一些文章。
  • 首页
  • 登入
  • 标签
  • 留言
  • 边栏
  • 链接
  • 归档
  • 星标日志
分页: 9/36 第一页 上页 4 5 6 7 8 9 10 11 12 13 下页 最后页 [ 显示模式: 摘要 | 列表 ]

2010年第一篇

2010/02/14 0 Comments

希望今年比去年更上一层楼,事业有成!

心情杂语
引用地址:
注意: 该地址仅在今日23:59:59之前有效

虎虎生威! 新年快乐!

2010/02/13 0 Comments
虎虎生威! 新年快乐!

祝大家阖家欢乐!
心情杂语 新年快乐
引用地址:
注意: 该地址仅在今日23:59:59之前有效

iconv转换UTF8-GB2312中字符不完整的解决办法

2010/02/10 0 Comments
经常要转换一下UTF8到GB2312的字符, 使用ICONV函数, 有时候发现只出现一部分, 后面一部分就丢失了。

搜索了一下google, 发现也有人发现这个问题, 这其实是ICONV的一个bug

解决方法:

在需要转成的编码后加 “//IGNORE” 也就是iconv函数第二个参数后.

如下:

iconv(”UTF-8″,”GB2312//IGNORE”,$data)

ignore的意思是忽略转换时的错误,如果没有ignore参数,所有该字符后面的字符串都无法被保存。


可以查看一下php手册:

iconv

(PHP 4 >= 4.0.5, PHP 5)

iconv — Convert string to requested character encoding

说明

string iconv ( string $in_charset , string $out_charset , string $str )

Performs a character set conversion on the string str from in_charset to out_charset .

参数

in_charset

The input charset.

out_charset

The output charset.

If you append the string //TRANSLIT to out_charset transliteration is activated. This means that when a character can't be represented in the target charset, it can be approximated through one or several similarly looking characters. If you append the string //IGNORE, characters that cannot be represented in the target charset are silently discarded. Otherwise, str is cut from the first illegal character.

str

The string to be converted.



返回值

Returns the converted string or FALSE on failure.

Web 开发 iconvutf8 , gb2312 , 字符丢失
引用地址:
注意: 该地址仅在今日23:59:59之前有效

Aptana Studio 2.0 Plugin  Zend studio  html编辑器插件

2010/02/09 0 Comments

Aptana Studio 2.0 Plugin Installation Instructions

Eclipse Update Site:
Installing via Aptana or Eclipse

Update Site:

http://download.aptana.org/tools/studio/plugin/install/studio

Detailed Directions:
  1. From the Help menu, select Install New Software... to open an Install pop-up window.
  2. In the Work with: text box of the Install window, type the URL http://download.aptana.org/tools/studio/plugin/install/studio for the update site, and hit the Enter key.
  3. In the populated table below, check the box next to the name of the plug-in, and click the Next button.
  4. Click the Next button to go to the license page.
  5. Choose the option to accept the terms of the license agreement, and click the Finish button.

Manual Installation: Download the Plugin Update Site

  1. Download Studio 2.0 Plugin zip.
  2. Open Eclipse distribution, and go to Help -> Install New Software....
  3. Click the Add... button to open the Add Site window.
  4. Click the Archive... button, and select the file saved in step 1.
  5. Select the appropriate plugins to install, and click Next -> Next.
  6. Click the Finish button.
Web 开发 aptana , zend , studio , php
引用地址:
注意: 该地址仅在今日23:59:59之前有效

function文件里的通用函数【不断增加】

2010/02/03 0 Comments
/**
 * 排序函数
 * @param string $ordername  排序的变量
 * @param string $order 排序的name order=1
 * @param string $sortname 顺序还是倒序  desc asc
 * @param string $sort  url里排序的变量如 sort=desc
 * @param string $url 要搜索的url
 */
function set_order_url($ordername="",$order = "order", $sortname="desc", $sort="sort" , $url=""){
 if(!empty($url)){
   //手动设置
      $url=$url.((strstr($url,'?'))?'&':'?').$order."=";
   }else{
   //自动获取
      if(empty($_SERVER['QUERY_STRING'])){
          //不存在QUERY_STRING时
       $url=$_SERVER['REQUEST_URI']."?".$order."=";
      }else{
    //存在QUERY_STRING时
       if($tempstr = strstr($_SERVER['QUERY_STRING'],$order.'=')){           
        //地址存在排序参数   
         $need = substr($tempstr,strlen($order.'='), strpos($tempstr, "&")-strlen($order.'='));
         $url=str_replace($order.'='.$need,'',$_SERVER['REQUEST_URI']);
         $last=$url[strlen($url)-1];
         if($last=='?'||$last=='&'){
             $url.=$order."=";
         }else{
             $url.='&'.$order."=";
         }         
       }else{
     //地址不存在排序参数
         $url=$_SERVER['REQUEST_URI'].'&'.$order.'=';
       } 
      }
   }
   $url .= $ordername;
   
   //升序降序处理
   $sortstr = "/".$sort.'=(desc|asc)/i';
   if(preg_match($sortstr, $url, $m)){
    //如果已经存在sort=则替换处理    
    $str = strtolower($m[1]) == "desc" ? "asc" : "desc";
    $url = str_replace($m[1], $str, $url);    
   }
   else{
    $url .= "&$sort=$sortname";
   }
   
   return $url;
}
Web 开发 php , function , 公用函数
引用地址:
注意: 该地址仅在今日23:59:59之前有效
分页: 9/36 第一页 上页 4 5 6 7 8 9 10 11 12 13 下页 最后页 [ 显示模式: 摘要 | 列表 ]
公告
需要添加链接的同学们,可以申请链接哦!
RSS feed Email feed
分类
  • 默认分类 [12] RSS
  • 心情杂语 [47] RSS
  • Linux 平台 [22] RSS
  • Windows 平台 [29] RSS
  • Web 开发 [35] RSS
  • Mysql [8] RSS
  • 网络技术 [9] RSS
  • 投资理财 [1] RSS
  • 软件逆向 [5] RSS
  • 网络安全 [3] RSS
  • 网络杂文 [3] RSS
  • 道听途说 [5] RSS
日历
< 2010 >    < 9 >
庚寅年(虎)
日 一 二 三 四 五 六
1234
567891011
12131415161718
19202122232425
2627282930
统计
访问次数 126876
今日访问 297
日志数量 178
评论数量 28
引用数量 0
留言数量 3
注册用户 1
在线人数 15
搜索
最新日志
  • MYSQL的优化[转]
  • PHP代码审计工具
  • Mrtg系统状态监控[C...
  • Awk学习笔记
  • PHP 生成中文验证码乱...
最新评论
  • 大量出售成品:(植物冰)...
  • 大量出售成品:(植物冰)...
  • ok,Replica O...
  • Recommend:le...
  • Keygen.exe 文...
链接
  • 友情链接
  • Jansfer
  • 阻击者的网络通行证
  • 大面面的博客
  • 华立的博客
  • 中国看电影CNKDY.COM
  • 爱书网
  • 噢噢动漫
  • DJ噢噢
  • QQ空间代理、代码查询
  • QQ空间查询器
  • 福建游戏论坛
  • kakapo's nest
  • 我爱美眉
  • 常用工具
  • 生活常用工具
  • 铁路客服中心
  • 网易文档
归档
  • 2010/09
  • 2010/08
  • 2010/07
  • 2010/06
  • 2010/05
其他
登入
注册
申请链接
RSS: 日志 | 评论
编码:UTF-8
XHTML 1.0

Top bo-blog
Copyright © 忆风居. Powered by Bo-Blog 2.1.1 ReleaseCode detection by Bug.Center.Team
闽ICP备09070078号
Valid XHTML 1.1 and CSS 3