Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #3061 > unrolled thread

ampersand help

Started bybob <bob@coolgroups.com>
First post2011-09-02 18:00 -0700
Last post2011-09-04 22:55 +0200
Articles 4 — 4 participants

Back to article view | Back to comp.lang.php


Contents

  ampersand help bob <bob@coolgroups.com> - 2011-09-02 18:00 -0700
    Re: ampersand help Jerry Stuckle <jstucklex@attglobal.net> - 2011-09-02 22:59 -0400
    Re: ampersand help "Twayne" <nobody@devnull.spamcop.net> - 2011-09-04 10:53 -0400
    Re: ampersand help "A" <a@a.a> - 2011-09-04 22:55 +0200

#3061 — ampersand help

Frombob <bob@coolgroups.com>
Date2011-09-02 18:00 -0700
Subjectampersand help
Message-ID<7a650168-4b19-4033-b73d-3e96d33ce531@h6g2000yqe.googlegroups.com>
Can someone tell me why this line of code doesn't work for replacing
an ampersand?

$newstring = str_replace("&", "and", $newstring);

[toc] | [next] | [standalone]


#3062

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-09-02 22:59 -0400
Message-ID<j3s579$g2d$1@dont-email.me>
In reply to#3061
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@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#3071

From"Twayne" <nobody@devnull.spamcop.net>
Date2011-09-04 10:53 -0400
Message-ID<j403e6$lnd$1@dont-email.me>
In reply to#3061
In news:7a650168-4b19-4033-b73d-3e96d33ce531@h6g2000yqe.googlegroups.com,
bob <bob@coolgroups.com> typed:
> Can someone tell me why this line of code doesn't work
> for replacing an ampersand?
>
> $newstring = str_replace("&", "and", $newstring);

Yes, but you'd do better to go get "The PHP Manual" on PHP and learn that 
and a lot more for yourself.

HTH,

Twayne`

[toc] | [prev] | [next] | [standalone]


#3073

From"A" <a@a.a>
Date2011-09-04 22:55 +0200
Message-ID<j40omp$gtr$1@gregory.bnet.hr>
In reply to#3061
> 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("&", "&amp;", $newstring); 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web