Write a PHP program to check if a given array of integers and length 2, does not contain 15 or 20.
<?php function test($nums) { return $nums[0] != 15 && $nums[0] != 20 && $nums[1] != 15 && $nums[1] != 20; } var_dump(test([12, 20])); var_dump(test([14, 15])); var_dump(test([11, 21]));
Sample Output:
bool(false) bool(false) bool(true)
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer