Use global variable inside function?
<p>I'm having trouble figuring out this in php.</p>

<p>I have a variable called $user that holds the user name.</p>

<p>In my function I need to make use of this variable:</p>

<pre><code>function test($message) {
    echo "user: $user, message: $message";
}
</code></pre>

<p>I only know how to do it by passing $user to the function each time I'm calling it, but i'm in a particular situation in which I cannot do it. So, how can I use a variable defined outside my function inside of it?</p>
