Bluehost.com Web Hosting $6.95

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

This is a discussion on Re: [PHP] explode and escape character for string separator within the PHP General forums, part of the PHP Programming Forums category; One set of delimiters I often use for text files is ~~ or ^^. They are fairly unique. If they do appear ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-18-2003
Brent Baisley
 
Posts: n/a
Default Re: [PHP] explode and escape character for string separator

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 just a single character. Although the upside
down ! or ? are nice if you are not using Spanish.

On Friday, July 18, 2003, at 03:04 PM, 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.

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

Reply With Quote
  #2 (permalink)  
Old 07-18-2003
Reuben D. Budiardja
 
Posts: n/a
Default Re: [PHP] explode and escape character for string separator

On Friday 18 July 2003 02:42 pm, Chris Shiflett wrote:
> --- "Reuben D. Budiardja" <reubendb@innovativethought.com> 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 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 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.

RDB


--
-------------------------------------------------
/"\ ASCII Ribbon Campaign against HTML
\ / email and proprietary format
X attachments.
/ \
-------------------------------------------------
Have you been used by Microsoft today?
Choose your life. Choose freedom.
Choose LINUX.
-------------------------------------------------

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:23 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0