note 94679 deleted from function.array-intersect-key by danbrown
| From: | danbrown@php.net | Date: | Wed, 18 Nov 2009 14:22:47 +0000 |
| Subject: | note 94679 deleted from function.array-intersect-key by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-163025@lists.php.net to get a copy of this message | ||
Note Submitter: chrisbloom7 at gmail dot com
----
Regarding my previous note, you could also use reset() or current() in place of implode().
<?php
$b = implode('', array_intersect_key(someFuncReturningAnArray(),
array('a'=>'')));
echo print_r($b, 1) . "\n----------\n";
$b = reset(array_intersect_key(someFuncReturningAnArray(), array('a'=>'')));
echo print_r($b, 1) . "\n----------\n";
$b = current(array_intersect_key(someFuncReturningAnArray(),
array('a'=>'')));
echo print_r($b, 1) . "\n----------\n";
?>
All return the identical result