Re: Splitting a complex string problem

From: Date: Sat, 10 Mar 2001 01:45:55 +0000
Subject: Re: Splitting a complex string problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-43267@lists.php.net to get a copy of this message
Maybe http://php.net/strtok -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: rm <richand2002@yahoo.com> Newsgroups: php.general Sent: Friday, March 02, 2001 12:56 PM Subject: [PHP] Splitting a complex string problem > I have a string that can be any length and contain any > number or words. Each string also has, somewhere > near end, a list of parameters that can begin with any > number of five or six different parameter markers. I > need to find the position of the first of these > parameters markers, which can be in any order, so I > can seperate the user string from the parameters...and > I can't change the way the information is provided. > > The only way I could get this to work is, since > there's only five different markers, locate the > position of each marker in the string, stick it in an > array, sort the array and find the first element that > is greater than 3 (the strpos uses an offset of 3 > since the user portion of the string cannot be less > than three charcters long plus a space), this element > has to be the marker and position that begins the > parameter portion of the string. > > Anyone know of a better more elegant ( read as faster) > way to handle this problem. > > rm > > __________________________________________________ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.yahoo.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#43267) next »