View Single Post
Old 02-21-2013, 10:45 PM   PM User | #6
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
$1 represents the value of the brackets located here: /\[poll(\d+)\]/i. $0 would be the entire matched string, which is typically a useless chunk for something like a preg_replace.
I ran that test above on codepad (I was surprised it worked since they have issues with pattern compiling). The results are a copy/paste of the source it generated. It may be wiser to use backreference with \1 instead of $1.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote