php - Store image file in dynamically created folder -


i want store image file path in variable , store file in folder created me using mkdir().

here folder creation code:

<?php $dirpath = "../leothian/jomres/uploadedimages/new_images2"; $result = mkdir($dirpath, 0777); if ($result == 1) {     $dirpath = "../leothian/jomres/uploadedimages/new_images2/property";     $result1=mkdir($dirpath,0777);     if($result1=1)     {     $dirpath = "../leothian/jomres/uploadedimages/new_images2/property/0";     $result2=mkdir($dirpath,0777);     if($result2)     {         $dirpath = "../leothian/jomres/uploadedimages/new_images2/property/0/medium";         $result3=mkdir($dirpath,0777);     }     $dirpath = "../leothian/jomres/uploadedimages/new_images2/slideshow";     $result4=mkdir($dirpath,0777);         if($result4=1)         {          $dirpath = "../leothian/jomres/uploadedimages/new_images2/slideshow/0";         $result5=mkdir($dirpath,0777);           }     } echo "folders created sucessfully"; }  else  {     echo "error creating folders"; } ?>      


Comments