note 97282 modified in function.array-intersect by danbrown
| From: | danbrown@php.net | Date: | Mon, 12 Apr 2010 14:54:16 +0000 |
| Subject: | note 97282 modified in function.array-intersect by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-168156@lists.php.net to get a copy of this message | ||
I used array_intersect in order to sort an array arbitrarly:
<?php
$a = array('one', 'two', 'three', 'four', 'five',
'six', 'seven', 'height', 'nine', 'ten');
$b = array('four', 'one', 'height', 'five')
var_dump(array_intersect($a, $b);
?>
will output:
0 => 'one'
1 => 'four'
2 => 'five'
3 => 'height'
i hope this can help...
--was--
I used array_intersect in order to sort an array arbitrarly:
$a = array('one', 'two', 'three', 'four', 'five',
'six', 'seven', 'height', 'nine', 'ten');
$b = array('four', 'one', 'height', 'five')
var_dump(array_intersect($a, $b);
will output:
0 => 'one'
1 => 'four'
2 => 'five'
3 => 'height'
i hope this can help...
http://php.net/manual/en/function.array-intersect.php