using global inside of function to get variable from included file. PHP
<p>Really simple I just think it's me. </p>

<p>this is file 1.php</p>

<pre><code>if(ctype_digit($_GET['id']))
{
    $item_id = "Hello";
}
else
{
    //Something
}
</code></pre>

<p>this is file 2.php</p>

<pre><code>function item_show(){

        $item_query = "SELECT title FROM tbl_items WHERE id='" . mysql_real_escape_string($item_id) . "' ";

}
</code></pre>

<p>Now my question is how do I get the value of <code>$item_id</code> from 1.php inside the function in 2.php ? </p>

<p>To add file 1.php and file 2.php are both included in index.php</p>
