Why is this returning the original string and not the edited string?
Original String:
I cant believe Ed ate [-food-] for breakfast.
Replace:
preg_replace_callback('/\[\-[a-zA-Z0-9_]\-\]/', 'tag_func', $email_body);
function tag_func($matches){
$matches[0] = 'tacos';
return $matches[0];
}
Outcome Desired String:
I cant believe Ed ate tacos for breakfast.
This is my warning I'm getting:
preg_replace_callback(): Requires argument 2, 'tag_func', to be a valid callback