Checking to see if a URL is Google
<p>I want to check a URL to see if it is a Google url or not.</p>

<p>I've got this function</p>

<pre><code>function isValidURL($url)
{
    return preg_match('|^http(s)?://google.com|i', $url);
}
</code></pre>

<p>If i try</p>

<pre><code>if ( isValidURL('http://google.com/') ){
    echo 'yes its google url';
}
</code></pre>

<p>It works fine. But if I try</p>

<pre><code>if ( isValidURL('http://www.google.com/') ){
    echo 'yes its google url';
}
</code></pre>

<p>(with <code>www</code>) I get an error!</p>
