[ create a new paste ] login | about

Link: http://codepad.org/4V7GWdja    [ raw code | output | fork ]

PHP, pasted on May 31:
1
2
3
4
5
6
7
<?php

$string = "an example";
$string = preg_replace('/(?<=\>)\b(\w*)\b|^\w*\b/', '<b>$0</b>', $string);
var_dump($string);

?>


Output:
1
string(17) "<b>an</b> example"


Create a new paste based on this one


Comments: