Write a PHP program to mutate the original array to filter out the values specified
- برمجة بي اتش بي
- 2021-09-08
- mhanasmh00489829403
الأجوبة
<?php
//Licence: https://bit.ly/2CFA5XY
function pull(&$items, ...$params)
{
$items = array_values(array_diff($items, $params));
return $items;
}
$items = ['a', 'b', 'c', 'a', 'b', 'c'];
print_r(pull($items, 'a', 'c'));
?>
Sample Output:
Array
(
[0] => b
[1] => b
)أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال