1 頁 (共 1 頁)

[問題]bbcode 內 code 與 php 有什麼分別?

發表於 : 2004-06-19 08:58
貓星少年
bbcode code 與 php 有什麼分別? :?: :mrgreen: :-D

發表於 : 2004-06-20 17:10
elvising

代碼: 選擇全部

對,就是這樣
[php]<?php
php就是多了個<?php ?>
?>[/php]

發表於 : 2004-06-20 19:54
貓星少年
即是使用上和效果上有什麼分別??
因為考慮應否裝此外掛

發表於 : 2004-06-20 22:48
elvising
裝吧,php語法code會把不同的command變成不同顏色~
看~
[php]
<?php
#echo uao_convert("明<br>");

function uao_load() {
global $uaotable;

$handle = fopen ( "uaocode.tbl", 'rb' );
$uaotable = fread( $handle, 65536 );
if ( strlen($uaotable) != 65536 ) {
die ("Unicode-At-On Table Loading Error!");
}
fclose($handle);
}

function uao_convert( $str ) {
global $uaotable;

if ( strlen($uaotable) < 65536 ) {
uao_load();
}

$res = "";

for ( $i=0; $i<(strlen($str)); $i++ ) {
$c = substr( $str, $i, 1 );
if ( ord($c) > 127 ) {
$i++;
$d = substr( $str, $i, 1 );
$a = ord($c) & 127;
$b = ord($d);
$offset = ( $a * 256 + $b ) * 2;
$u_hi = substr( $uaotable, $offset, 1 );
$u_lo = substr( $uaotable, $offset+1, 1 );
$unicode = ord($u_hi) * 256 + ord($u_lo);
$res .= ( $unicode == 0 ) ? "$c$d" : "&#$unicode;";
}
else {
$res .= $c;
}
}
return $res;
}

?>
[/php]

發表於 : 2004-06-21 11:34
動機不明
貓星少年 寫:即是使用上和效果上有什麼分別??
因為考慮應否裝此外掛
你的站是 php 相關研究站嗎?
如果不是,那就不必裝了... (我認為可有可無的一個功能)