I am trying to grab the capital letters of a couple of words and wrap them in span tags. I am using preg_replace for extract and wrapping purposes, but it\'s not outputting
\0 will also match the entire matched expression without doing an explicit capture using parenthesis.
preg_replace("/[A-Z]/", "\\0", $str)
As always, you can go to php.net/preg_replace or php.net/
\0 or $0 refers to the text matched by the whole pattern.