Welcome Guest, Not a member yet? Register   Sign In
Alternative PHP Syntax question
#1

[eluser]Chris Newton[/eluser]
Code:
private function _mkdir_recursive($pathname, $mode=0777)
    {
        is_dir(dirname($pathname)) || $this->_mkdir_recursive(dirname($pathname), $mode);
        return is_dir($pathname)  || mkdir($pathname, $mode,TRUE);
    }

Recursive functions always have my brain in a twist, and this one uses some obscure form of PHP syntax that I'm just not getting. Can anyone please take a moment and write this out in long PHP, or at least direct me to the PHP documentation that explains how this syntax works. Every time I try to make sense of it using standard if/else statements it just doesn't seem to get to the point that it works or makes sense to me.

I know the code WILL work to create folders, but I'd prefer to understand HOW. I just keep staring at it, and the code doesn't make any sense to me. Any help would be greatly appreciated.


Messages In This Thread
Alternative PHP Syntax question - by El Forum - 07-29-2008, 04:12 PM
Alternative PHP Syntax question - by El Forum - 07-29-2008, 05:13 PM
Alternative PHP Syntax question - by El Forum - 07-29-2008, 05:22 PM
Alternative PHP Syntax question - by El Forum - 07-29-2008, 05:52 PM
Alternative PHP Syntax question - by El Forum - 07-29-2008, 05:52 PM
Alternative PHP Syntax question - by El Forum - 07-29-2008, 10:20 PM
Alternative PHP Syntax question - by El Forum - 07-29-2008, 10:47 PM
Alternative PHP Syntax question - by El Forum - 07-30-2008, 04:03 AM
Alternative PHP Syntax question - by El Forum - 07-30-2008, 08:12 AM
Alternative PHP Syntax question - by El Forum - 07-30-2008, 12:22 PM
Alternative PHP Syntax question - by El Forum - 07-30-2008, 12:48 PM
Alternative PHP Syntax question - by El Forum - 07-30-2008, 01:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB