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,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 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,441
    Thanks
    62
    Thanked 537 Times in 524 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
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • 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,647
    Thanks
    2
    Thanked 406 Times in 398 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,441
    Thanks
    62
    Thanked 537 Times in 524 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
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!


  •  

    Posting Permissions

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