note 106434 added to function.count
| From: | alex dot hristov dot 88 at gmail dot com | Date: | Wed, 09 Nov 2011 11:18:53 +0000 |
| Subject: | note 106434 added to function.count | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184349@lists.php.net to get a copy of this message | ||
In addition to gothamxi's note-it should be
<?php
$count_topics=count($topic)-1;
echo ("What do you think about ".$topic[ rand( 0, $count_topics ) ]."? ");
?>
Otherwise the [0] value of the array will never be shown and in some cases it would display.
<?php
//What do you think about?
?>
----
Server IP: 69.147.83.197
Probable Submitter: 193.24.240.116
----
Manual Page -- http://www.php.net/manual/en/function.count.php
Edit -- https://master.php.net/note/edit/106434
Del: integrated -- https://master.php.net/note/delete/106434/integrated
Del: useless -- https://master.php.net/note/delete/106434/useless
Del: bad code -- https://master.php.net/note/delete/106434/bad+code
Del: spam -- https://master.php.net/note/delete/106434/spam
Del: non-english -- https://master.php.net/note/delete/106434/non-english
Del: in docs -- https://master.php.net/note/delete/106434/in+docs
Del: other reasons-- https://master.php.net/note/delete/106434
Reject -- https://master.php.net/note/reject/106434
Search -- https://master.php.net/manage/user-notes.php