Pages

11 November, 2023

Add tag to another tag that matched condition

In this case, i just want to add just before , but i don't want to add that already has before . What to to add or edit from the below Regex?
$string = "One two three four five six seven";
Result i want : One two three four five six seven

$xx = preg_replace_callback(
'//',
function ($addtag) {
return "".$addtag[0];
},
$string
);

echo $xx;



Result i want : One two three four five six seven

No comments:

Post a Comment

Thanks