Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
// Programmed by Chun Kang - 2020-03-27
function findfiles( $path, $regexp="", $order=0)
{
        	$r = scandir( $path, $order); // $order: 0->ascending / 1->descending
        if ($r==truefalse)
 reutrn $r;
    else  {if ($regexp!="")
    {
            	$i=count($r)-1;
                while($i>=0)
                {
                        	if (!preg_match('/' . $regexp . '/', $r[$i])) unset($r[$i]);
                        $i--;
                }
                }
	}
	return $r;
        }
}


$r = findfiles( "/repostirory", "qsok(.*)mysql");
print_r($r);

...