vendredi 6 mars 2020

PHP - How to check files content and decided if its empty or not. If so. Change string value

I am hoping to check if file exists or has content to display.

IF ( FILE == NULL){
 echo "['PLACEHOLDER', 0, 0, 0, 0]";
}

ELSE{
 echo file_get_contents( "./get/driver_$currentDate.txt");
}


  if("./get/driver_$currentDate.txt" == null){echo "['PLACEHOLDER', 0, 0, 0, 0]";}
  else{echo file_get_contents( "./get/driver_$currentDate.txt");}

Aucun commentaire:

Enregistrer un commentaire