|
|
|
| Данная конструкция выделяет жирным любую цифру в тексте.
<?
echo $text = "sd34f sg2v sdf 1141111 dfg s2dfg df s1df 22432 dfg sdfg s2-dhg df 333333<br />";
$search = "/(\d{1})/";
$replace= "<b>\$1</b>";
echo $text = preg_replace($search, $replace, $text);
?>
|
А вот как подсветить любую укву и не жирным а красным цветом. | |
|
|
|
|
|
|
|
для: Port_Artur1
(03.06.2008 в 20:07)
| |
<?
$text = "sd34f sg2v sdf 1141111 dfg s2dfg df s1df 22432 dfg sdfg s2-dhg df 333333<br />";
$search = "/([a-zA-Z]{1})/";
$replace= "<font color=\"#FF0000\">\$1</font>";
echo $text = preg_replace($search, $replace, $text);
|
| |
|
|
|
|
|
|
|
для: sim5
(03.06.2008 в 20:51)
| | Спасибо | |
|
|
|