Jump to content
php.lv forumi

Directory ielasiishana array-aa


justus

Recommended Posts

<?php
$dir = opendir("/lala/");
while ($fails = readdir($dir)) if($fails != "." && $fails !="..") $masivs[] = file_get_contents($fails);
?>

 

Kaa vienmeer man ir slinkums notesteet, rakstu no galvas :)

 

Updeits:

Mh, patesteeju, iet :)

+ veel izdomaaju, ka veel nodereetu pielikt pie ifa lai vinsh paarbauda fai $fails nav basename($_SERVER['PHP_SELF']) :) (tas buus noderiigi, ja skripts staavees tajaa pashaa diraa kur visi tie txt faili

 

<?php
$dir = opendir("/lala/");
while ($fails = readdir($dir)) if($fails != "." && $fails !=".." && $fails != basename($_SERVER['PHP_SELF'])) 
$masivs[] = file_get_contents($fails);
?>

Edited by rnc
Link to comment
Share on other sites

×
×
  • Create New...