Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie preg_replace question

Status
Not open for further replies.

leegold2

Technical User
Oct 10, 2004
116
What does "$0" do? The results change if I use "$1" why?

$a = "Foo moo boo tool foo";
$b = preg_replace("/[A-Za-z]oo\b/", "Got word: $0 ", $a);

Thanks,
Lee G.
 
variables cannot start with a number. $0 and $1 do not refer, therefore to variables.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top