Check if a function exists or not in PHP
<p>I wants to check if a function exists or not. I am using function_exists() to check.</p>

<pre><code>$func = $_GET['function'];
$func();
if(function_exists('func'))
{
    echo "Exists";
}
else
{
    echo "Invalid Function name called";
}
</code></pre>

<p>Okay now I have a function called <code>register</code>, and I am calling it like this:</p>

<pre class="lang-none prettyprint-override"><code>www.example.com/index.php?function=register
</code></pre>

<p>Okay, it is working fine, because that function does exist.
But if,</p>

<pre class="lang-none prettyprint-override"><code>www.example.com/index.php?function=registerssss
</code></pre>

<p>It gives me this error:</p>

<blockquote>
  <p>Call to undefined function registerssss()</p>
</blockquote>

<p>I want to print my custom error as I have posted above. Is there a solution?</p>