字节顺序记号(英:byte-order mark,BOM)是位于码点 U FEFF 的统一码字符("零宽度无断空白")。当以 UTF-16 或 UTF-32 来将UCS/统一码字符所组成的字串编码时,这个字符被用来标示其字节序。它常被用来当做标示文件是以 UTF-8 、 UTF-16 或 UTF-32 编码的记号。
- class cryption {
- function en($str,$key) {
- $ret='';
- $str = base64_encode ($str);
- for ($i=0; $i<=strlen($str)-1; $i ){
- $d_str=substr($str, $i, 1);
- $int =ord($d_str);
- $int=$int^$key;
- $hex=strtoupper(dechex($int));
- $ret.=$hex;
- }
- return $ret;
- }
- function de($str,$key) {
- $ret='';
- for ($i=0; $i<=strlen($str)-1; 0){
- $hex=substr($str, $i, 2);
- $dec=hexdec($hex);
- $dec=$dec^$key;
- $ret.=chr($dec);
- $i=$i 2;
- }
- return base64_decode($ret);
- }
- }
- $cryption=new cryption;
- ?>
复制代码
- /*
- * Created on 2012-3-23
- *
- * To change the template for this generated file go to
- * Window - Preferences - PHPeclipse - PHP - Code Templates
- */
- $content = '';
- preg_match('/]*src=["']屁屁[/]?(. ?)["']屁屁[^>]*>/si', $content, $matches);
-
- print_r($matches);
- echo '
';
-
- preg_match('/]*src=["']屁屁[/]?(. ?)["']屁屁[^>]*>/si', $content, $matches);
- print_r($matches);
-
- define('HTTP_PATH','http://'.$_SERVER['HTTP_HOST']);
- $img = getimagesize(HTTP_PATH.$matches[1]);
- print_r($img);
-
- mb_internal_encoding('UTF-8');
- $a = '我爱你 I love you';
-
- echo mb_strlen($a);
- echo '
';
- echo mb_substr($a,1,2);
-
- ?>
-
复制代码
- // ----------------------------------------------------------------------
- // | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
- // ----------------------------------------------------------------------
- // | Copyright (c) 2009 http://thinkphp.cn All rights reserved.
- // ----------------------------------------------------------------------
- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
- // ----------------------------------------------------------------------
- // | Author: liu21st
- // ----------------------------------------------------------------------
-
- // 定义ThinkPHP框架路径
- define('THINK_PATH', 'ThinkPHP');
-
- //定义项目名称和路径
- define('APP_NAME', 'Home');
- define('APP_PATH', 'Home');
-
-
- define('NO_CACHE_RUNTIME', true);
- //define('RUNTIME_ALLINONE', true);
-
-
- // 加载框架入口文件
- require(THINK_PATH."/ThinkPHP.php");
-
- //实例化一个网站应用实例
- App::run();
- ?>
复制代码
|