Check both valid URL and valid Domain Name
<p>i am using the following function, this gives me the right output but ONLY it checks is URL pattern not correct Domain name...</p>

<pre><code>    filter_var($url, FILTER_VALIDATE_URL)
</code></pre>

<p>If i'll enter the correct URL  it displays it is valid but if i'll enter the correct URL but not  correct Domain name still it is displays the Valid URL..</p>

<pre><code>Ex.
    http://www.google.co.in
    Output: Valid

    http://www.google
    output: Invalid

    http://www.google.aa
    output: Valid
</code></pre>

<p>In the third case it should be Invalid...</p>

<p>Any references would be appreciated...</p>
