matak
06-01-2007, 04:57 PM
Actually i have an array of starting positions like this
EDIT: Array ( [0] => 2 ) Array ( [0] => 5 ) Array ( [0] => 8 )
and after 2 characters, all of the chars need to be bolded
How can i place html tags eg <b></b> to string based on that array
$string = "Textthatisnotbold";
$positions = array( 2, 5, 8);
$positionend = 2;
function place_tag($string, $positions, $positioned) {
//functiont to give THIS result
}
Te<b>xt</b>t<b>ha</b>tis<b>not</b>bold
Crack this one guyz, and you got beer from me :D
EDIT: Array ( [0] => 2 ) Array ( [0] => 5 ) Array ( [0] => 8 )
and after 2 characters, all of the chars need to be bolded
How can i place html tags eg <b></b> to string based on that array
$string = "Textthatisnotbold";
$positions = array( 2, 5, 8);
$positionend = 2;
function place_tag($string, $positions, $positioned) {
//functiont to give THIS result
}
Te<b>xt</b>t<b>ha</b>tis<b>not</b>bold
Crack this one guyz, and you got beer from me :D