Re: string into array
| From: | Joel Ricker | Date: | Thu, 27 Sep 2001 22:52:40 +0000 |
| Subject: | Re: string into array | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-69065@lists.php.net to get a copy of this message | ||
: I need to take a string and read it into an array character by character
: here is an example
:
:
:
: $str="this is a string";
:
: so if I printed $array[0] would be = t
:
: can somebody help?
Stirngs can be accessed with a subscript just like arrays.
For example:
<?php
$astring = "Hi. I'm a String.";
print $astring[1];
?>
printed i.
Hope that helped,
Joel