filtering out array values
| From: | Merlin | Date: | Tue, 02 Nov 2004 13:32:35 +0000 |
| Subject: | filtering out array values | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-200917@lists.php.net to get a copy of this message | ||
Hi there,
I am retrieving some values out of the db and would only like to show those available inside a drop down field. Now I do have 2 arrays which fill the drop down field and one array with the values which should only show up.
Example:
$objects_available = array(3,5,7);
$ob_options = array( 'all available', 'accomodations', 'internet access', 'tour operators', 'restaurants' , 'pubs', 'clubs', 'museums', 'secret spots', 'hotels at the airport');
$ob_values = array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
Has anybody an idea how to filter just the ones out which are inside the objects available array? I am sure this is possible without any if statements, but just cant come up with a clear programming solution.
Can anybody help with a good solution?
Thank you in advance,
merlin