dcole.ath.cx Posted August 23, 2006 Share Posted August 23, 2006 Is this correct?while(!is_dir($dir)){// there is something in here that makes $dir change...}is this correct? while(!is_dir($dir))if not what is the correct way? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 23, 2006 Share Posted August 23, 2006 The syntax is legal, I can't tell you if it is semantically correct or not.Have you not used a while loop before? What are you questioning about the syntax? Link to comment Share on other sites More sharing options...
dcole.ath.cx Posted August 23, 2006 Author Share Posted August 23, 2006 The ! Link to comment Share on other sites More sharing options...
justsomeguy Posted August 24, 2006 Share Posted August 24, 2006 The ! operator negates a boolean value, so !true == false and !false == true. So the statement !is_dir($dir) evaluates to true if is_dir returns false, meaning that $dir is not a directory. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now