note 83581 deleted from function.implode by felipe
| From: | felipe@php.net | Date: | Tue, 03 Jun 2008 11:05:19 +0000 |
| Subject: | note 83581 deleted from function.implode by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-140082@lists.php.net to get a copy of this message | ||
Note Submitter: John cancelled your birthday
----
Heads up!
<?php
$data[] = "only_one_value_in_array";
$tags = implode(' OR ', $data);
echo $tags;
?>
output is
"only_one_value_in_array OR only_one_value_in_array"
If you do a join on an array that only has one value the implode function will use it twice instead
of just skipping it. Why does PHP fight us every step of the way?