PHP custom function scope / good practice
<p>I have script which has the following structure:</p>

<pre><code>&lt;?php
    if( a == b ){

        function some_function_name(){
            // do something here
        }

        if( c == d ){
            some_function_name();
        }
    }
?&gt;
</code></pre>

<p>I get an error message saying that some_function_name(); does not exist.</p>

<p>What am I doing wrong and is this good practice?</p>

<p>I want to create a function, because I have a bunch of steps which I need to use many times, and I would prefer not to have to copy/paste the same code over and over again.</p>
