i want to read files in my directory using php ..
in detail: 
i am creating a multiple file uploader in php and this is my code  

**top section:**

```
<?php
  session_start();
  $name=$_SESSION['albumname'];
  echo '<h3 align="center">You are upload image in album '.$name.' </h3>';
  $mk=@mkdir("../galleryimg/$name", 0755);

?>

```

**form**

```
<form enctype="multipart/form-data" action="" method="post">
  <br>
  <p class="button-height">
    <span class="input file"><span class="file-text"></span><span class="button compact">Select files</span><input type="file" multiple="" class="file withClearFunctions" value="" id="special-input-1" name="file[]" style="height:30px;"></span>
  </p>
  <a class="button icon-new-tab add_more" href="javascript:void(0)">Add nore files</a>
  <button class="button green-active" name="button">Upload</button>
</form>

```

**script for adding multiple file items**

```
<script type="text/javascript">
$(document).ready(function(){
    $('.add_more').click(function(e){
        e.preventDefault();
        $(this).before("<p class='button-height'><span class='input file'><span class='file-text'></span><span class='button compact'>Select files</span><input type='file' multiple='' class='file withClearFunctions' value='' id='special-input-1' name='file[]' style='height:30px;'></span></p>");
    });
});
</script>

```

**php for upload**

```
<?php
if(isset($_POST['button'])) {
  $target_path = "../galleryimg/".$name."/";

  for($i=0; $i<count($_FILES['file']['name']); $i++){
    $ext = explode('.', basename( $_FILES['file']['name'][$i]));
    $target_path = $target_path . md5(uniqid()) . "." . $ext[count($ext)-1]; 

    if(move_uploaded_file($_FILES['file']['tmp_name'][$i], $target_path)) {
      echo "The file has been uploaded successfully <br />";
    } 
    else{
      echo "There was an error uploading the file, please try again! <br />";
    }
  }
}
?>

```

**this reading directory** 

```
<?php
if ($handle = opendir('../galleryimg/'.$name)) {
  /* This is the correct way to loop over the directory. */
  while (false !== ($entry = readdir($handle))) {
    echo "$entry"."<br>";
  }

  closedir($handle);
}
?>

```

now i want to get the file name of dir = '../galleryimg/'.$name for entering into data base and its out put is

**output is**

```
..
108e196207d5b79aabd4ff1aece93ed61.png

```

**My Question**
i want to subtract the first line how to do that (..) .