![]() |
|
首页 │ Apache │ Linux│ Java│ MySQL│ 注册│帮助 | |||
这是我在网上找的一个代码,可是为什么我一运行,就是这样的错,高手帮忙看看!!我想弄一个高亮显示的代码,可是弄不出来!!
Warning: preg_match() [function.preg-match]: Unknown modifier 'p' in D:\www\index1.php on line 5
(.*?)/s',,)) { =1; =''; ob_start(); highlight_string(); = ob_get_contents(); ob_end_clean(); = addslashes(); =preg_replace("/(.*?)/s","",,1); } }while(); return ; }
[PHP]<?php
function HeighPHPcode($Heightstring){
do{
$z=0;
if(preg_match('/
$z=1;
$code='';
ob_start();
highlight_string($reg[1]);
$code = ob_get_contents();
ob_end_clean();
$reg[1] = addslashes($reg[1]);
$Heightstring=preg_replace("/
}
}while($z);
return $Heightstring;
}
############################################################################
#$PHPcode就是要被加亮的代码
$PHPcode= <<
<?php
function HeighPHPcode($Heightstring){
do{
$z=0;
if(preg_match('/
$z=1;
$code='';
ob_start();
highlight_string($reg[1]);
$code = ob_get_contents();
ob_end_clean();
$reg[1] = addslashes($reg[1]);
$Heightstring=preg_replace("/
}
}while($z);
return $Heightstring;
}
END;
#############################################################################
echo HeighPHPcode("$PHPcode");
?>[/PHP] [B]Warning: preg_match() [function.preg-match]: Unknown modifier 'p' in D:\www\index1.php on line 5[/B] [B]1[/B]

