ampersand help [message #175311] |
Sat, 03 September 2011 01:00 |
bob
Messages: 11 Registered: February 2011
Karma: 0
|
Junior Member |
|
|
Can someone tell me why this line of code doesn't work for replacing
an ampersand?
$newstring = str_replace("&", "and", $newstring);
|
|
|
Re: ampersand help [message #175312 is a reply to message #175311] |
Sat, 03 September 2011 02:59 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 9/2/2011 9:00 PM, bob wrote:
> Can someone tell me why this line of code doesn't work for replacing
> an ampersand?
>
> $newstring = str_replace("&", "and", $newstring);
Works just fine here. What's in $newstring, both before and after the call?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
|
Re: ampersand help [message #175320 is a reply to message #175311] |
Sun, 04 September 2011 20:55 |
A
Messages: 17 Registered: June 2011
Karma: 0
|
Junior Member |
|
|
> Can someone tell me why this line of code doesn't work for replacing
> an ampersand?
> $newstring = str_replace("&", "and", $newstring);
There is no problem in that particular line. Perhaps the problem is
elsewhere for example in initialization of $newstring ?
What exactly are you trying to do? And what is the content of $newstring?
Maybe a dumb question but are you trying to do this instead?
$newstring = str_replace("&", "&", $newstring);
|
|
|