使用 jsoup 从 HTML 中提取所有链接的例子
字节顺序记号(英:byte-order mark,BOM)是位于码点 U+FEFF 的统一码字符(零宽度无断空白)。当以 UTF-16 或 UTF-32 来将UCS/统一码字符所组成的字串编码时,这个字符被用来标示其字节序。
字节顺序记号(英: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;
?>
2. [文件] test.php ~ 769B 下载(15) 跳至 [1] [2] [3] [全屏预览]
<?php
/*
* Created on 2012-3-23
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
$content = '<div class="img_area"><img width="95" height="70" src="/web/public/images/news/95x70_1.jpg" title=""></div>';
preg_match('/<img[^>]*src=["\']{1}[\/]?(.+?)["\']{1}[^>]*>/si', $content, $matches);
print_r($matches);
echo '<br/>';
preg_match('/<img[^>]*src=["\']{1}[\/]?(.+?)["\']{1}[^>]*>/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 '<br/>';
echo mb_substr($a,1,2);
?>
3. [文件] sdfasdfasf ~ 962B 下载(5) 跳至 [1] [2] [3] [全屏预览]
<?php
// +----------------------------------------------------------------------
// | 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 <liu21st@gmail.com>
// +----------------------------------------------------------------------
// 定义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();
?>
精彩图集
精彩文章







