New to programming, function does not work inside class : <pre><code>&lt;?php

class spel {

  function randomWoord() {
      $woorden = array(
          'Juan',
          'Luis',
          'Pedro',
          // and so on
        );
      return $woorden[rand ( 0 , count($woorden) -1)];
  }

  print randomWoord();

  }

?&gt;
</code></pre>

<p>New to programming, function does not work inside class. When I remove the class, it does work. How can I fix this.</p>
