Re: Checking url validation

From: Date: Fri, 29 Mar 2002 20:35:31 +0000
Subject: Re: Checking url validation
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-90713@lists.php.net to get a copy of this message
Oops ... That's not balanced. Add another ) at the end of the if. /bsh/ Billy S Halsey wrote:
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 ]=--------------------------------------------/

« previous php.general (#90713) next »