note 90558 added to control-structures.foreach
| From: | timgolding_10 at hotmail dot com | Date: | Tue, 28 Apr 2009 09:52:47 +0000 |
| Subject: | note 90558 added to control-structures.foreach | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-153894@lists.php.net to get a copy of this message | ||
You can also use foreach to loop through a string iterating through each character in that string
with the following:
<?php
$string = "hello";
foreach((array)$string as $char)
echo $char;
// hello
?>
----
Server IP: 92.48.74.199
Probable Submitter: 82.153.163.251
----
Manual Page -- http://www.php.net/manual/en/control-structures.foreach.php
Edit -- https://master.php.net/note/edit/90558
Del: integrated -- https://master.php.net/note/delete/90558/integrated
Del: useless -- https://master.php.net/note/delete/90558/useless
Del: bad code -- https://master.php.net/note/delete/90558/bad+code
Del: spam -- https://master.php.net/note/delete/90558/spam
Del: non-english -- https://master.php.net/note/delete/90558/non-english
Del: in docs -- https://master.php.net/note/delete/90558/in+docs
Del: other reasons-- https://master.php.net/note/delete/90558
Reject -- https://master.php.net/note/reject/90558
Search -- https://master.php.net/manage/user-notes.php