[PHP] explode and escape character for string separator

2003-07-18 Thread Reuben D. Budiardja
Hi all, Suppose I have a long string like $myStr = "$string1:$string2:$string3"; I can obviously explode them using ":" as the separator. But what if $string1 contains the character ":" by itself? I was thinking, first I am gonna put an escaping character, so I can do something like: $string1

Re: [PHP] explode and escape character for string separator

2003-07-18 Thread Chris Shiflett
--- "Reuben D. Budiardja" <[EMAIL PROTECTED]> wrote: > Suppose I have a long string like > $myStr = "$string1:$string2:$string3"; > > I can obviously explode them using ":" as the separator. But what if > $string1 contains the character ":" by itself? You should strive to make your delimiter uni

Re: [PHP] explode and escape character for string separator

2003-07-18 Thread Reuben D. Budiardja
On Friday 18 July 2003 02:42 pm, Chris Shiflett wrote: > --- "Reuben D. Budiardja" <[EMAIL PROTECTED]> wrote: > > Suppose I have a long string like > > $myStr = "$string1:$string2:$string3"; > > > > I can obviously explode them using ":" as the separator. But what if > > $string1 contains the chara

Re: [PHP] explode and escape character for string separator

2003-07-18 Thread CPT John W. Holmes
> On Friday 18 July 2003 02:42 pm, Chris Shiflett wrote: > > --- "Reuben D. Budiardja" <[EMAIL PROTECTED]> wrote: > > > Suppose I have a long string like > > > $myStr = "$string1:$string2:$string3"; > > > > > > I can obviously explode them using ":" as the separator. But what if > > > $string1 cont

Re: [PHP] explode and escape character for string separator

2003-07-18 Thread Brad Pauly
Reuben D. Budiardja wrote: I did strive for that. But whatever character I choose, the problem remains that we can't guarantee that it's going ot be only used as deliminater, since the deliminated string is an input from user. So the problem remains. Are you adding the delimiter? If so, maybe yo

Re: [PHP] explode and escape character for string separator

2003-07-18 Thread Brent Baisley
One set of delimiters I often use for text files is ~~ or ^^. They are fairly unique. If they do appear in a file then there is probably garbage in the file and I want to know about. For my templates "delimiter" I use {::TagName::}. You could use }::{ as your delimiter. Don't limit yourself to

Re: [PHP] explode and escape character for string separator

2003-07-18 Thread Reuben D. Budiardja
On Friday 18 July 2003 03:01 pm, you wrote: > > On Friday 18 July 2003 02:42 pm, Chris Shiflett wrote: > > > --- "Reuben D. Budiardja" <[EMAIL PROTECTED]> wrote: > > > > Suppose I have a long string like > > > > $myStr = "$string1:$string2:$string3"; > > > > > > > > I can obviously explode them usi

Re: [PHP] explode and escape character for string separator

2003-07-18 Thread Jason Wong
On Saturday 19 July 2003 03:04, Reuben D. Budiardja wrote: > > You should strive to make your delimiter unique. A delimiter that might > > possibly appear within the items it is meant to delimit is no longer a > > delimiter. > > I did strive for that. But whatever character I choose, the problem r

Re: [PHP] explode and escape character for string separator

2003-07-18 Thread Tyler
load a bunch of characters into an array. Do a loop through that array and check all of your $strings for the current character in your loop. If the current array character does not exist in any of them, you have your delimiter. I could put together an example if you want me to. __

Re: [PHP] explode and escape character for string separator

2003-07-18 Thread Chris Sherwood
en rebuild the string and delimit it yourself Chris - Original Message - From: "Reuben D. Budiardja" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, July 18, 2003 11:47 AM Subject: [PHP] explode and escape character for string separator Hi all, Suppose

Re: [PHP] explode and escape character for string separator

2003-07-18 Thread CPT John W. Holmes
From: "Reuben D. Budiardja" <[EMAIL PROTECTED]> > > This is a hypothetical situation. The real situation is that I am trying to > have a protocol for data sent by client using Flash. But the basic question > remains. So FLASH is creating the string that you must decode in PHP? Is there any way to

Re: [PHP] explode and escape character for string separator

2003-07-18 Thread Reuben D. Budiardja
do I know which "_" is my doing? Because in my case, it's faily conceivable that "_" will get used. RDB > Chris > - Original Message - > From: "Reuben D. Budiardja" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent

Re: [PHP] explode and escape character for string separator

2003-07-18 Thread Chris Shiflett
--- Reuben D. Budiardja wrote: > I did strive for that. But whatever character I choose, the problem > remains that we can't guarantee that it's going ot be only used as > deliminater, since the deliminated string is an input from user. So > the problem remains. Well, just to point out, your delim

Re: [PHP] explode and escape character for string separator

2003-07-18 Thread Reuben D. Budiardja
On Friday 18 July 2003 03:43 pm, CPT John W. Holmes wrote: > From: "Reuben D. Budiardja" <[EMAIL PROTECTED]> > > > This is a hypothetical situation. The real situation is that I am trying > > to > > > have a protocol for data sent by client using Flash. But the basic > > question > > > remains. > >

Re: [PHP] explode and escape character for string separator

2003-07-18 Thread Grant Rutherford
Chris Shiflett wrote: --- Reuben D. Budiardja wrote: I did strive for that. But whatever character I choose, the problem remains that we can't guarantee that it's going ot be only used as deliminater, since the deliminated string is an input from user. So the problem remains. Well, just to

Re: [PHP] explode and escape character for string separator

2003-07-18 Thread Cesar Cordovez
Among other things, this is why XML exists. Use XML. FLASH can handle it, PHP can handle it, everything out there can handle it. Use XML. Delimiters will sooner or later break down. Use XML. Over and out. Grant Rutherford wrote: Chris Shiflett wrote: --- Reuben D. Budiardja wrote: I d

Re: [PHP] explode and escape character for string separator

2003-07-18 Thread Curt Zirzow
Reuben D. Budiardja <[EMAIL PROTECTED]> wrote: > Anything simple, and fast? xml is simple, and fast to implement. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php