Re: [PHP] separated string by comas

2002-07-22 Thread Jason Wong

On Monday 22 July 2002 14:56, [EMAIL PROTECTED] wrote:
> I have a string that is separated by spaces like this
> $string="test test1 test2 test3";
> how can I make the string so it is separated by comas like this
> $string="test,test1,test2,test3";
> I know this is probably simple but I just can't figure it out

str_replace()

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Forced to support NT servers; sysadmins quit.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] separated string by comas

2002-07-21 Thread Martin Towell

$string = str_replace(" ", ",", $string);

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 22, 2002 4:57 PM
To: php-general
Subject: [PHP] separated string by comas



I have a string that is separated by spaces like this
$string="test test1 test2 test3";
how can I make the string so it is separated by comas like this
$string="test,test1,test2,test3";
I know this is probably simple but I just can't figure it out

  

-- 
Best regards,
 rdkurth  mailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php