subdomain extract without regex with php
<p><strong>is there a great way to extract subdomain with php without regex ?</strong></p>

<p>why without regex ? </p>

<p>there are a lot of topic about this, one if them is <a href="http://stackoverflow.com/questions/535336/find-out-subdomain-using-regular-expression-in-php">Find out subdomain using Regular Expression in PHP</a></p>

<blockquote>
  <p>the internet says it consumes memory a
  lot, if there is any consideration or
  you think better use regex ( maybe we
  use a lot of function to get this
  solution ) please comment below too.</p>
</blockquote>

<p>example</p>

<pre><code>static.x.com = 'static'
helloworld.x.com = 'helloworld'
b.static.ak.x.com = 'b.static.ak'
x.com = ''
www.x.com = ''
</code></pre>

<p>Thanks for looking in.</p>

<p>Adam Ramadhan</p>
