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
Post a Comment