title: Trying to detect word in array
body: <p><a href="https://i.stack.imgur.com/lvuiq.png" rel="nofollow noreferrer">enter image description here</a>First of all, I am new to programming and my code might be a mess. I want to detect a word from an array. I've searched the internet and I found in_array. This is my code: </p>
  
  <p>Array of detectable words:  </p>
  
  <pre><code>function randomWoord() {
      $woorden = array(
        'appel',
        'boom',
        'auto',
        'school',
        'tafel',
        'laptop',
        'huis',
        'zomer',);
  </code></pre>
  
  <p>Function trying to detect the word:</p>
  
  <pre><code>function isWoord($woord){
      if (in_array("appel", $woorden)) {
          echo "Found";
      }
    }
  </code></pre>
  
  <pre><code>echo $spel-&gt;isWoord();
  </code></pre>
  
  <p>But when I do this I get this error:</p>
  
  <p>Fatal error: Uncaught ArgumentCountError: Too few arguments to function spel::isWoord(), 0 passed in /opt/lampp/htdocs/DG2/DG2Galgje/galgje.php on line 48 and exactly 1 expected in /opt/lampp/htdocs/DG2/DG2Galgje/galgje.php:32 Stack trace: #0 /opt/lampp/htdocs/DG2/DG2Galgje/galgje.php(48): spel->isWoord() #1 {main} thrown in /opt/lampp/htdocs/DG2/DG2Galgje/galgje.php on line 32</p>
  
  <p>How can I fix this, thanks in advance!</p>