use single quotes: double quotes would confuse php with variable names.
it thinks that $General is a variable and replace it by it's empty content.
single quotes prevent php from evaluating the string:
$test_string = '1.2$General/ms1.zip';
single quotes on regex too (same reason). the
-
From: Uli B [mailto:[EMAIL PROTECTED]]
Sent: Saturday, June 29, 2002 11:56 AM
To: PHP List
Subject: Re: [PHP] need to change $ char in string
use single quotes: double quotes would confuse php with variable names.
it thinks that $General is a variable and replace it by it's empty content.
single
== (2) is for comparison while you are accidently doing assignments by
= (1)
if ($lastname=) - wrong
if ($lastname==) - better
that's why u r screwed up here :-)
Uli
At 17:49 30.06.02 -0500, Richard Lynch wrote:
In article 03d201c21db6$7deb2110$7800a8c0@leonard , [EMAIL PROTECTED]
(Leo) wrote:
- don't use /^ .. $/ if you want to replace all occurences. ^ and $ refer
to the very start and end of the whole string
and make no sense at all - at least in this case. your regexp will not
match at all unless $var contains only a
single variable and nothing more
- either capture
4 matches
Mail list logo