View Single Post
Old 25-03-2009, 14:15   #13
funkyCable
Inactive
 
Join Date: Aug 2005
Location: Canvey Island, Essex
Services: SERVICES FROM 26/08/05 TV XL services 2MB BROADBRAND UNLIMITED TALK PACKAGE V+ Service (Since 18
Posts: 1,195
funkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nice
Re: need help with pointing to an ubuntu directory. Using LAMPP

You were right it was just a filename/directory name not an actual path.

PHP Code:
<?php
  $dir    
'/opt/lampp';
  
$files1 scandir($dir);
?>
Directory <br />
<?php
  
foreach ($files1 as $fileobject){
    
$file $dir "/" $fileobject;
    if (
is_dir($file)){
    echo 
"$fileobject<br>";
  }
}
?>
<br /><b>Files:</b><br />
<?php
foreach ($files1 as $fileobject){
  
$file $dir "/" $fileobject;
  if (
is_file($file)){
    echo 
"$fileobject<br>";
  }
}
?>
<br /><b>File type:</b><br />
<?php
  
foreach ($files1 as $fileobject){
    
$file "/opt/lampp/" $fileobject;
    echo 
"$fileobject : " filetype($file) . "<br>";
  }
?>
<br /><b>File Sizes:</b><br />
<?php
  
foreach ($files1 as $fileobject){
    
$file "/opt/lampp/" $fileobject;
    echo 
filesize($file) . "<br>";
  }
?>
This clearly shows what is a directory and what is a file.
funkyCable is offline   Reply With Quote