calling function inside preg_replace thats inside a function

try preg_replace_callback

return preg_replace_callback("/\[video\](.+?)\[\/video\]/", 'embed_video', $Text);

function embed_video($matches)
{
  return $matches[1] . 'foo';      
}

Leave a Comment