Mega Code Archive

 
Categories / Php / Code Snippets
 

File exists with PHP and Java

<?php //file to be found $fp = new Java("java.io.File", "d:/lotto.txt"); //check if file exists if($fp->exists()) { echo "The file ". $fp->getAbsolutePath() . " is ". $fp->length(). " bytes"; } //file does not exist else { echo "The file " . $fp->getAbsolutePath() . " does not exist"; } ?>