I want to write a php object in a text file. The php object is like that
$obj = new stdClass();
$obj->name = "My Name";
$obj->birthdate = "YYYY-MM-DD";
$obj->position = "My position";
I want to write this $obj in a text file. The text file is located in this path
$filePath = getcwd().DIRECTORY_SEPARATOR."note".DIRECTORY_SEPARATOR."notice.txt"
I want a simple way to write this object into the text file and want to read the file to get the properties as I defined. Please help me.
Thanks in advance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With