PHP - How to check a subfolder for a single file? -


    $code="524";     $filepath="/assets/$code/";     $file="";     if(@fopen($path,"r")){          // code // replace function here (ill this)      }  echo '<a href="link.php?go=$file">your colour is: </a>'; 
  • /assets/542
  • /assets/542_blush/
  • /assets/542_blush/542_blush.jpg

at moment, code going 3 digits, have subfolder underscore , color , inside 1 file..

php has file_exists() function;

if ( file_exists( '/assets/' . $code . '_blush/' . $code . '_blush.jpg' ) ) {     // ... } 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -