Thread: preg_replace
View Single Post
Old 08-22-2008, 08:19 PM   #4 (permalink)
xenon
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

$1 says "just copy the first captured group into a variable called $1", which is the first reference of the captured group, so you don't have to copy and paste that expression every time you need to use it. Every groups that are captured (are between paranthesis), are numbered, in the order they match, starting from 1.
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote