Re: Split Function and Week Numbers
From: Brian (brian_at_nrwp.co.uk)
Date: 04/16/04
- Next message: Lo Dolce Pesca: "Re: binary data"
- Previous message: Dmitry Ruban: "Re: fsockopen on IIS"
- In reply to: Tim Van Wassenhove: "Re: Split Function and Week Numbers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 16 Apr 2004 15:09:43 +0100
Thanks Tim that did the trick
Brian
> > I know I can use $incoming= split(" ", "$message");
> > and then use $incoming[0] and $incoming[1] to get
> > the first two strings, but how would I get the rest in one
> > string? The last could be any length?
>
> First you ltrim on the string, so there are no leading spaces.
> Next you use strpos to determine the position of the first space.
> With substr 0,pos you get the first word.
> With substr pos+1,strlen($word) you get the rest of the string (=word2).
>
> Now do the same on word2 to find the 2nd word.
> The remainder of that string, is the last part :)
- Next message: Lo Dolce Pesca: "Re: binary data"
- Previous message: Dmitry Ruban: "Re: fsockopen on IIS"
- In reply to: Tim Van Wassenhove: "Re: Split Function and Week Numbers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|