Re: Checking url validation
| From: | Billy S Halsey | Date: | Fri, 29 Mar 2002 20:34:31 +0000 |
| Subject: | Re: Checking url validation | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-90711@lists.php.net to get a copy of this message | ||
Try an extra layer of parens:
if (($fp = fopen("http://www.anyurl.com", "r") == NULL)
{
echo "not valid";
}
else
{
echo "this is a valid url";
}
Roberts, Mark wrote:
I am using the following to verify a url: if (!$fp = fopen("http://www.anyurl.com", "r")) { echo "not valid"; } else { echo "this is a valid url"; } I always get a not valid message. What am I doing wrong? Is there a better way to do this? Mark Roberts Sr. Systems Analyst LanApps/Web Development The Williams Information Services Corporation 918-573-1706 mark.roberts@williams.com-- /---------------------------------------------=[ BILLY S HALSEY ]=--\ | Member of Technical Staff, Sun Microsystems, Inc. ESP Solaris SW | | "All opinions and technical advice offered in this message are my | | own and not necessarily endorsed by my employer." | \--=[ bsh-php@sun.com ]=--------------------------------------------/