php-general | 2000071
Date: 07/13/00
- Next message: Nick: "[PHP] Re: [PHP-DB] update multiple fields in MySQL"
- Previous message: Derick Schuetz: "[PHP] Strings and Arrays"
- In reply to: Derick Schuetz: "[PHP] Strings and Arrays"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Just loop through it with a for loop.
ie.
$word = "abc";
for($i=0; $i<strlen($word); $i++) {
echo $word[$i];
}
-Rasmus
On Thu, 13 Jul 2000, Derick Schuetz wrote:
> I read somewhere in the annotated manual that strings are character arrays.
> I am very unfamiliar with the use of arrays in PHP, so I am wondering if
> someone could throw me a quick pointer or two. I want to print a modified
> block of html code for each letter in a string. So if I create a function
> that can be passed the string itself, how would I print out the block of
> code for each individual letter in the array? This is the code I tried to
> use, but it did not work:
>
> function unnamed( $word ) {
> GLOBAL $val;
>
> reset ( $word );
> while (list ($val) = each ($word)) {
> echo "HTML CODE FOR EACH LETTER";
> }
>
> Thanks!
>
> Derick Schuetz
> dschuetz <email protected>
>
>
>
>
>
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Nick: "[PHP] Re: [PHP-DB] update multiple fields in MySQL"
- Previous message: Derick Schuetz: "[PHP] Strings and Arrays"
- In reply to: Derick Schuetz: "[PHP] Strings and Arrays"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

