Write a PHP program to filter out the elements of a given array, that have one of the specified values

  • برمجة بي اتش بي

Write a PHP program to filter out the elements of a given array, that have one of the specified values.

الأجوبة

<?php
//Licence: https://bit.ly/2CFA5XY

function without($items, ...$params)
{
    return array_values(array_diff($items, $params));
}
print_r(without([2, 1, 2, 3], 1, 2));

?>

Sample Output:

Array
(
    [0] => 3
)
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...