I have a variable that I am trying to examine its content that is called asynchronously, so I cannot do a normal var_dump($variable) for example. I have been trying to write the variable content to a file, but not having success. This is the function including the file write code. I'm not sure of the data type of the $dataobject. How can I determine its type and dump its content into the data.txt file?
public function insert_record($table, $dataobject) {
$dataobject = (array)$dataobject;
$columns = $this->get_columns($table);
$cleaned = array();
$fp = fopen('../../data.txt', 'w');
foreach ($dataobject as $field => $value) {
//fwrite($fp, print_r($field), print_r($value) );
// fwrite($fp, print($field), print($value) );
// fwrite($fp, var_export($value) );
}
fclose($fp);
}
fwrite($fp, var_export($value, true));