trying to run a function within a class <p>I am trying to call a function within my class. But when i try to call it errors out and says "Fatal error: Call to undefined function" even though its defined within my class.</p> <pre><code> function checkArray($day, $array){ foreach ($array as $key =&gt; $value) { if (array_search($day, $value)) return $key; } return false; } </code></pre> <p>And i try to call it like this within another function of the class</p> <pre><code>if(checkArray($i,$events)){ echo $events[checkArray($i,$events)]["short"]; } </code></pre> <p>if i test this code without using a class, it works perfect. But within a class it seems like it doesn't let me call a function that is within a class. I'm kind of new to OOP so i know it might seem like a dumb question.</p>