RE: [PHP] posted urls
| From: | Sterling Hughes | Date: | Fri, 14 Sep 2001 06:52:38 +0000 |
| Subject: | RE: [PHP] posted urls | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-67342@lists.php.net to get a copy of this message | ||
On Fri, 14 Sep 2001 Lawrence.Sheed@dfait-maeci.gc.ca wrote:
> ereg_replace or str_replace perhaps?
>
> eg
>
> $something= "this is a sentence";
>
> $something = ereg_replace (" ","+", $something);
>
> print $something;
>
That'll work, although str_replace is faster and better...
fyi, if you want to encode a string for a URL, use the urlencode()
function.
-Sterling
> -----Original Message-----
> From: Egon Schmid [mailto:eschmid@php.net]
> Sent: September 14, 2001 2:20 PM
> To: Alexander Skwar
> Cc: murat; php-general@lists.php.net
> Subject: Re: [PHP] posted urls
>
>
> Alexander Skwar wrote:
> >
> > So sprach »murat« am 2001-09-13 um 14:34:31 +0300 :
> > > how can i change variables that has two or more words to variables that
> > > has "+" instead of blanks in that variables.
> > > Like this: "word1 word2 word3" => "word1+word2+word3"
> >
> > $word1 . $word2 . $word3
> >
> > Read the manual!
>
> Alexander, please don't try to educate people with a RTFM. Your solution
> to the above problem is obviously wrong.
>
> -Egon
>
>