现在的位置: 首页 > 综合 > 正文

2013年08月22日 ⁄ 综合 ⁄ 共 1882字 ⁄ 字号 评论关闭

1.QQ生成。
http://wp.qq.com/index.html

2.支付宝

接口地址:www.alipay.com/cooperate/gateway.do

3.傻逼都可以做wordpress的网址教程:http://fairyfish.net/2007/06/04/so-you-want-to-create-wordpress-themes-huh/

4.magento比较好的博客:http://www.wemvc.com/1187.html

5.屏蔽中文浏览器的代码:if (window.navigator.userLanguage.indexOf('zh-cn')> -1) document.location.href = '/404/';

6.修改数据库信息:

打开Magento根目录下的app/etc/local.xml文件,找到如下代码:

view source
print?
01.<default_setup>
02. <connection>
03. <host><![CDATA[localhost]]></host>
04. <username><![CDATA[username]]></username>
05. <password><![CDATA[password]]></password>
06. <dbname><![CDATA[database]]></dbname>
07. <active>1</active>
08. </connection>
09. </default_setup>

7.在程序中使用static block,譬如:网页尾部等这些经常修改的信息,可以使用static block编辑:

 <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('home_footer')->toHtml() ?>
     其中home_footer是static block的  Identifier;

8。输出配置信息:

<?php

header('Content-Type: text/plain');        
 echo $config = Mage::getConfig()
 ->loadModulesConfiguration('config.xml')       
 ->getNode()
 ->asXML();         
 exit;

?>

 

9.wordpress汉化:

       1.wp-content/languages/zh_CN.mo
       2.wp-config.php这个文件
          define ('WPLANG', 'zh_CN');

10.PHP编码转换函数:

gb2312转换成utf-8

$utf=iconv('GB2312', 'UTF-8', $_REQUEST['keyword']);

 

将字符串utf-8码转换为gb2312码

$str   = iconv("UTF-8","GB2312//TRANSLIT",$str);

 

PHP编码转换函数

iconv() 函数 Definition and Usage 定义和用法 iconv()函数的作用是:转换字符串的编码。

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

Tips and Notes 注意点注意:第二个参数,除了可以指定要转化到的编码以外,还可以增加两个后缀://TRANSLIT 和 //IGNORE,其中 //TRANSLIT 会自动将不能直接转化的字符变成一个或多个近似的字符,//IGNORE 会忽略掉不能转化的字符,而默认效果是从第一个非法字符截断。

mb_convert_encoding() 函数 Definition and Usage 定义和用法 mb_convert_encoding()函数的作用是:转换字符串的编码。

Description string mb_convert_encoding ( string str, string to-encoding [, mixed from-encoding])

注意:但是需要先enable mbstring 扩展库。两者区别:mb_convert_encoding 中根据内容自动识别编码;mb_convert_encoding功能强大,但是执行效率比iconv差太多;

总结:一般情况下用 iconv,只有当遇到无法确定原编码是何种编码时才用 mb_convert_encoding 函数.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

抱歉!评论已关闭.