PHP Exercises: Check if a given array of integers contains no 3 or a 5
115. Array Contains No 3 or 5 Check
Write a PHP program to check if a given array of integers contains no 3 or a 5.
Sample Solution:
PHP Code :
Sample Output:
bool(true) bool(true) bool(false) bool(true)
Flowchart:

For more Practice: Solve these Related Problems:
- Write a PHP script to return true if an array does not contain any occurrences of 3 or 5.
- Write a PHP function to iterate over an array and output true only if neither 3 nor 5 is present.
- Write a PHP program to use logical conditions to verify that an array lacks both 3 and 5.
- Write a PHP script to employ array filtering to confirm an array is free of the values 3 and 5, then return a boolean.
PHP Code Editor:
Contribute your code and comments through Disqus.
Previous: Write a PHP program to check if a given array of integers contains a 3 or a 5.
Next: Write a PHP program to check if an array of integers contains a 3 next to a 3 or a 5 next to a 5 or both.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.