Re: Fw: [PHP] Looking at individual chars of string

2003-03-17 Thread zerof
Try: "; echo "So, echo \$vlr16200{0};returns the FIRST character of \"$vlr16200\", or, \"$vlr16201\"."; echo "and, echo \$vlr16200{9};returns TENTH, character of \"$vlr16200\", ou seja, \"$vlr16202\"."; ?> -- zerof -- PHP General Mailing List (http://www.php.net/) To

Re: Fw: [PHP] Looking at individual chars of string

2003-03-17 Thread Bix
Much appreciated! "Erik Price" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > Kevin Stone wrote: > > > Actually as far as the computer knows strings *are* arrays. Access any > > character within a string in the same mannor as you would access an element > > in an array. For ex

Re: [PHP] Looking at individual chars of string

2003-03-17 Thread Bix
Cheers buddy! "Erik Price" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > Bix wrote: > > Is it possible to look at individual chars of a string? > > > > eg: $str = "12345"; > > > > print $str_1 // Gives "1" > > print $str_2 // Gives "2" > > Try this: > >print $str{0}; // giv

Re: Fw: [PHP] Looking at individual chars of string

2003-03-17 Thread Erik Price
Kevin Stone wrote: Actually as far as the computer knows strings *are* arrays. Access any character within a string in the same mannor as you would access an element in an array. For example: $str = "hello world"; echo $str[4]; // prints o echo $str[6]; // prints w That works but is deprecated

Re: [PHP] Looking at individual chars of string

2003-03-17 Thread Erik Price
Bix wrote: Is it possible to look at individual chars of a string? eg: $str = "12345"; print $str_1 // Gives "1" print $str_2 // Gives "2" Try this: print $str{0}; // gives "1" print $str{1}; // gives "2" Erik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http

Fw: [PHP] Looking at individual chars of string

2003-03-17 Thread Kevin Stone
- Original Message - From: "Bix" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 17, 2003 12:04 PM Subject: [PHP] Looking at individual chars of string > Is it possible to look at individual chars of a string? > > eg: $str = "12345&quo

[PHP] Looking at individual chars of string

2003-03-17 Thread Bix
Is it possible to look at individual chars of a string? eg: $str = "12345"; print $str_1 // Gives "1" print $str_2 // Gives "2" Doing this with an array would be handy, maybe using explode or preg_split? Thanks in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, vi