note 48258 deleted from ref.strings by derick
| From: | derick@php.net | Date: | Wed, 09 Feb 2005 18:10:37 +0000 |
| Subject: | note 48258 deleted from ref.strings by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-84738@lists.php.net to get a copy of this message | ||
Note Submitter: hackajar <matt> yahoo <trot> com
----
I don't see anywhere you would convert a string to an array for each character is in it.
Why would you do this? the C language treats "string" as an array of
"char"'s. This line would be fitting to keep your coding methods the same:
for($i=0; $i<strlen($string);$i++) {
$Cstring[$i]=substr($string, $i, 1);
}
Now $Cstring is your "C Like" array string. This is also handy if you need to parse
thorugh a string for offset reasons, and substr just doesn't tickel your fancy