Why not check for the file and then act accordingly?
if(file_exists("/home/user/data.log"))
$cmd = "tail -75 /home/user/data.log";
else if(file_exists("/home/user/log/data2.log"))
$cmd = "tail -75 /home/user/log/data2.log";
else
die("No file to tail");