RE: [PHP] need to change $ char in string
| From: | Beverly Steiner | Date: | Mon, 01 Jul 2002 16:07:17 +0000 |
| Subject: | RE: [PHP] need to change $ char in string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-104708@lists.php.net to get a copy of this message | ||
Jason,
Thank you, explode using single quotes and no backslashes works!
Bev
-----Original Message-----
From: Jason Wong [mailto:php-general@gremlins.com.hk]
Sent: Monday, July 01, 2002 10:57 AM
To: php-general@lists.php.net
Subject: Re: [PHP] need to change $ char in string
On Monday 01 July 2002 22:47, Beverly Steiner wrote:
> Uli & others,
>
> Thanx for the suggestions. This works as stated but the data already
> exists in this format from an old database and I'm trying to parse it into
> logical fields. Originally the data in the field looked something like
> 1$General/ms1.zip#12$Another/xqy.zip#. I deleted the ending # then used
> explode to separate the information on the # and now I need to separate
the
> info before the $ from what comes after it. I've tried everyone's
> suggestions but they only work if I'm testing and can define the string
> using single quotes.
>
> How can I split on a $
<? # split string on '$'
$doo = '1$General/ms1.zip';
$dah = explode('$', $doo);
print_r($dah);
?>
>or change the $ to something else if I'm getting the
> information from a database (MySQL), not defining it using single quotes
> like in your example?
I think you're confused. There is nothing in MySQL which dictates strings as
single-quoted or double-quoted. I think you had best post some code. Show us
how you're retrieving the data from MySQL.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Two heads are better than one.
-- John Heywood
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php