title: How to check if two specific values are the only values appearing in an array?
body: <p>I have an array that could contain any number of values, some of which may recur.</p>
  
  <p>Example: 1,2,2,5,7,3</p>
  
  <p>How can I write a test in PHP that checks to see if the only values contained in the array are either 1 or 2?</p>
  
  <p>So 1,2,2,1,1,1 would return true.</p>
  
  <p>Meanwhile 1,2,3,1,2,1 would return false.</p>