thanks!
On Thu, 11 Dec 2003 22:57:38 GMT, Senator Jay Billington Bulworth
<funha@fung.arg> wrote:
[color=blue]
>In article <3fd8eff2.5231537@news.clari.net.au>,
tino@tino.com wrote:
>[color=green]
>> ie. If MYVARIABLE has the data "hello,there,big,world".
>>
>> I would like to be able to say, pickup the 3rd field "big" without
>> knowing the character positions or lengths.[/color]
>
><?php
>$MYVARIABLE = 'hello,there,big,world';
>
>#Method 1
>$fields = explode(',', $MYVARIABLE);
>//3rd field is now in $fields[2];
>
>#Method 2
>$tok = strtok($MYVARIABLE, ',');
>$count = 0;
>while($tok){
> $count++;
> if($count == 3){
> $thirdfield = $tok;
> break;
> }
> $tok = strtok(',');
>}
>?>
>
>hth
>
>--
>Bulworth :
funha@fung.arg | My email address is ROT13 encoded, decode to mail
>--------------------------|--------------------------------------------------
><http://www.phplabs.com/> | PHP scripts and thousands of webmaster resources![/color]