note 69797 added to language.types.array
| From: | petruzanautico at yahoo dot com dot ar | Date: | Thu, 21 Sep 2006 15:30:59 +0000 |
| Subject: | note 69797 added to language.types.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-117381@lists.php.net to get a copy of this message | ||
Regarding the message of phoenixbytes:
The line foreach($bad as $baddies); will just yield in $baddies the last value of the array $bad.
I think that wasn't your intention, in that case there are faster and better ways than foreach.
I think what you wanted to do is:
<?php
foreach($bad as $baddies) // make a collection
{
if (preg_match("/$baddies/i", $mailto)) // find a match
{
$addrmail = "false";
}
else
{
$addrmail = "true";
}
} // foreach end
?>
----
Server IP: 201.216.232.3
Probable Submitter: 200.114.166.165
----
Manual Page -- http://www.php.net/manual/en/language.types.array.php
Edit -- https://master.php.net/note/edit/69797
Del: integrated -- https://master.php.net/note/delete/69797/integrated
Del: useless -- https://master.php.net/note/delete/69797/useless
Del: bad code -- https://master.php.net/note/delete/69797/bad+code
Del: spam -- https://master.php.net/note/delete/69797/spam
Del: non-english -- https://master.php.net/note/delete/69797/non-english
Del: in docs -- https://master.php.net/note/delete/69797/in+docs
Del: other reasons-- https://master.php.net/note/delete/69797
Reject -- https://master.php.net/note/reject/69797
Search -- https://master.php.net/manage/user-notes.php