note 36107 added to function.strlen
| From: | php-general at lists dot php dot net | Date: | Thu, 25 Sep 2003 22:13:20 +0000 |
| Subject: | note 36107 added to function.strlen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-57139@lists.php.net to get a copy of this message | ||
> a little modification of rasmus solution
>
> $tmp=0; $s="blah";
> while($c=$s[$tmp++]) { echo $c; }
>
> but what happens when the string contains zeros?
> $s="blah0blah";
> the script stops....
Then use this:
<?php
$tmp=0; $s="blah0blah";
while( ord($c = $s[$tmp++]) )
echo $c;
?>
----
Manual Page -- http://www.php.net/manual/en/function.strlen.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+36107
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+36107&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+36107&report=yes