defining with ()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

defining with ()

Post 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];
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: defining with ()

Post 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];
Post Reply