Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: directory script

  1. #11
    Join Date
    Oct 2005
    Posts
    255
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    well without the brachets it didnt work..

    you guys are confusing me...
    Hey new design new look, goto xudas for personal webdsign help.. (:

  2. #12
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    if (strpos($file, '.') === 0) continue;
    What else DOES that do?
    Omits any UNIX hidden files (ones that start with a .). This includes the directories "." and "..".
    I find the brackets still helpful if skimming quickly (as if to find a section of the code).
    Hm, I always rely on indentation for this. Otherwise one has to keep track of every single brace in order to know exactly how many levels deep one is.
    Also, the real reason for including it is to be absolutely correct. I see omitting the brackets as a shortcut, just like omitting the ; in javascript.
    But omitting a semicolon in Javascript is bad because it can lead to the code looking like it does something completely different to what it actually does:
    Code:
    var a = 3,
      b = 1 + a
    (b - 4) && doSomething()
    ... and is inserted anyway. Omitting a brace isn't nearly so ambiguous, especially with proper indentation, and doesn't make extra work for the compiler/interpreter.
    thankyou you forgot to put some '{' in there but i got it thankyou..
    No, I actually accidentally left one in (the last one, I was editing your code, and it was outside the visible area of my textbox).
    well without the brachets it didnt work..

    you guys are confusing me...
    Don't mind us, we just went off on a tangent about coding style
    Last edited by Twey; 11-01-2007 at 10:41 PM.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #13
    Join Date
    Oct 2005
    Posts
    255
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    omg i understood that... thankyou... i learned that in math.. lol
    Hey new design new look, goto xudas for personal webdsign help.. (:

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •