Just how can I access the suits when making use of preg_replace in PHP?
I am attempting to order the uppercase of a number of words and also cover them in period tags. I am making use of preg_replace for extract and also covering objectives, yet it's not outputting anything.
preg_replace("/[A-Z]/", "<span class=\"initial\">$1</span>", $str)
From the preg_replace documentation on php.net :
substitute might have referrals of the kind \ n or (given that PHP 4.0.4 ) $n,. with the last kind being the. favored one. Every such reference. will certainly be changed by the message recorded. by the n'th parenthesized pattern.
See Flubba's instance.