Skip to content

Instantly share code, notes, and snippets.

@pinscript
Created January 20, 2011 12:03
Show Gist options
  • Save pinscript/787796 to your computer and use it in GitHub Desktop.
Save pinscript/787796 to your computer and use it in GitHub Desktop.
function jens($matches)
{
$path = '';
$parts = explode(',', $matches[1]);
foreach($parts as $match)
$path .= '/' . str_replace('\'', '', trim($match));
return $path;
}
$replaced = preg_replace_callback('/<\?php myclass->my_function\((.*?)\); \?>/', 'jens', $str);
echo $replaced;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment