Page 1 of 1

defining with ()

Posted: Mon Jul 23, 2007 7:45 pm
by m2babaey
Hi
what is this code doing:

Code: Select all

$is_reachable = (stristr($dir_atual,$doc_root)!==false);
and:
$expanded_dir_list .= ":".$mat[$x];
the 2nd code was at a file manager script like this:
  $mat = explode("/",$path_info["dirname"]);
        for ($x=0;$x<count($mat);$x++) $expanded_dir_list .= ":".$mat[$x];

Re: defining with ()

Posted: Mon Jul 23, 2007 8:27 pm
by Benjamin

Code: Select all

// are the contents of $doc_root inside of the $dir_atual variable?
// if so set $is_reachable to true, else false
$is_reachable = (stristr($dir_atual,$doc_root) !==false);

// add a : and the value of $mat[$x] to $expanded_dir_list
$expanded_dir_list .= ":".$mat[$x];

// split the path into chunks using / as a divider and place the pieces into an array
$mat = explode("/",$path_info["dirname"]);

// loop through each piece and add it to $exanded_dir_list prepending it with a :
for ($x=0;$x<count($mat);$x++) $expanded_dir_list .= ":".$mat[$x];