I am trying to log some data for a bug fix of a project. I have a boolean which i need to write to a text file but for some reason the boolean is never printed below is the code that calls the function to write the log.
writeLog("Index: $index Create Table Headers: ". $myBoolean);
And below is the code of the function that actually writes to the file
function writeLog($message)
{
$file = "log.txt";
$fh = fopen($file, 'a') or die("Can't open file");
$content = $message . "\r\n";
fwrite($fh, $content);
fclose($fh);
}
When the file is written All I am getting is
Index: 0 Create Table Headers:
I have tried using var_export($myBoolean) but didn’t make any difference
Thanks for any help you can provide.
Try
See PHP Documentation for the “?” ternary operator