Extract Information from post content (using regex?)
This belongs to stackoverflow. Here’s a solution anyway: $content = preg_replace_callback(‘/\%replaceContent:{(.*?)}\%/’, ‘do_replacements’, $content); function do_replacements($matches){ $type = $matches[1]; // here’s your {type} $replacement = “…replacement for {$type}”; return $replacement; }