jsoup 從 HTML 中提取所有鏈接的例子
字節順序記號(英: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;
?>
test.php
<?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);
?>
sdfasdfasf ~ 962B 下載(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();
?>
preview.jpg
imgs/asCode/08191113_VVe5.jpg
本文由用戶 bxtlarry 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!