How to get sitename in php?
<p>REQUEST_URI is the following:</p>

<pre><code>["REQUEST_URI"]=&gt; string(36) "/example/site-name.php"
</code></pre>

<p>I wold like to get just: <code>site-name</code></p>

<p>What is the easiest/shortest way to get this?</p>

<hr>

<pre><code>function get_site_name($site=null)
{
    if(!$site)$site = $_SERVER['PHP_SELF'];
    return basename($site, '.php');
}
</code></pre>
