Re: Fw: [PHP] Looking at individual chars of string
| From: | Erik Price | Date: | Mon, 17 Mar 2003 19:14:34 +0000 |
| Subject: | Re: Fw: [PHP] Looking at individual chars of string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-140007@lists.php.net to get a copy of this message | ||
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 wThat works but is deprecated. Use curlies. http://www.php.net/manual/en/language.types.string.php#language.types.string.substr Erik