Restrict scope of variable within include file in php <p>I am facing variable conflicting issues in application i am designing.</p> <p>e.g in one of my web application page, there are two modules</p> <p>i: tag clouds module ii: photo listing module</p> <p>both have variable <strong>$listOrder</strong> , e.g when script processing module "<strong>tag cloudes</strong>" it set <strong>$listOrder = "tagid desc"</strong> as its not set initially.</p> <pre><code>if(!isset($listOrder)) $listOrder = "tagid desc"; </code></pre> <p>When script reach to photo listing module again it try to process the following line as shown above. as variable is already set in tag cloud list. it keeps "tagid desc" as value. which causes sql error as "tagid" is not a field of photo listing.</p> <p>This is simple example there are more than 4 or 5 modules with lots of similar variables in every page, which cause conflicts.</p> <p>Can we do something to restrict scope of variable to module level in php to avoid such conflicts.</p>