![]() |
|
|
+ Search |
![]()
|
Aug 7th, 1999 23:03
Nathan Wallace, unknown unknown, James Reed
A string ($foo) is already an array. You can do something like this to
walk across the string like an array:
The only difference is that instead of using count() to find the number
of elements in this "array", you use strlen().
<?
$foo = "abcdefghi";
for ($i=0; $i<strlen($foo); $i++) {
echo $i, " -- ", $foo[$i], "<br>";
}
?>