Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jun 2011
    Posts
    119
    Thanks
    43
    Thanked 0 Times in 0 Posts

    opendir function

    what does opendir('.') in php do?
    What is '.' inside the bracket does?
    A '.' cannot be a string path!!

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,978
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    '.' is a relative path. It means this directory, which in PHP will be the same directory as the executing script. '..' would mean up one directory.

  • Users who have thanked Fou-Lu for this post:

    ippo (09-20-2012)

  • #3
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,089
    Thanks
    51
    Thanked 506 Times in 493 Posts
    Quote Originally Posted by ippo View Post
    A '.' cannot be a string path!!
    Yup, it certainly can - you've a lot to learn! If you've ever used Dos, you'd recognise . and ..

    .. in dos was always at the top of any directory listing along with .

    They've both been used since the age of the dinosaurs in computer operating systems and are both perfectly valid in php code too
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  • Users who have thanked tangoforce for this post:

    ippo (09-20-2012)

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    Quote Originally Posted by tangoforce View Post
    If you've ever used Dos
    Or pretty much any other OS command line, including unix, linux, BSD, etc.

  • #5
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,089
    Thanks
    51
    Thanked 506 Times in 493 Posts
    Quote Originally Posted by tangoforce View Post
    They've both been used since the age of the dinosaurs in computer operating systems and are both perfectly valid in php code too
    Yup, I covered that already
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!


  •  

    Posting Permissions

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