CuDemVN.Wap.Sh



![]() | ![]() ![]() ![]() |
Khi sử dụng hàm highlight_string() thì đoạn code của bạn sẽ được tô màu field, method,... cho dễ nhìn hơn là một đống chữ đen xì lì hack thị giác
Và đây là code, có thể mod vào file bbcode của mọi mã nguồn nhé
<?php
$text = 'không có gì [php]<?php abc ?>[/php] ahihi mã 2 nè [php]<?php def ?>[/php]'; // văn bản
if(preg_match('/\[php\]/i', $text)) {
$atext = explode("[/php]", $text);
$ltext = count($atext) - 1;
for($wi = 0; $wi < $ltext; $wi++) {
$atext[$wi] = strrchr($atext[$wi], "[php]");
$atext[$wi] = str_replace('[php]','',$atext[$wi]);
$text = str_replace('[php]'.$atext[$wi].'[/php]', highlight_string($atext[$wi], 1), $text);
}
}
echo $text;
?>
$text = 'không có gì [php]<?php abc ?>[/php] ahihi mã 2 nè [php]<?php def ?>[/php]'; // văn bản
if(preg_match('/\[php\]/i', $text)) {
$atext = explode("[/php]", $text);
$ltext = count($atext) - 1;
for($wi = 0; $wi < $ltext; $wi++) {
$atext[$wi] = strrchr($atext[$wi], "[php]");
$atext[$wi] = str_replace('[php]','',$atext[$wi]);
$text = str_replace('[php]'.$atext[$wi].'[/php]', highlight_string($atext[$wi], 1), $text);
}
}
echo $text;
?>
Cách dùng:
[php]code php của bạn[/php]
Nguồn: NhokTapYeu - WTai.Tk
↓ Tập tin Đính kèm ↓

Đánh giá: 4.5/ 5, 500 bình chọn
