I have learned that to create a structure, I can create an array like so:
$MyStructure = array (
'id' => '12345',
'name' => 'myName');
I also know, to write into a file, I can use:
file_put_contents($fileName, $myTextToSave, FILE_APPEND);
But, this function stores it in simple text format.
I want to know about functions such as in C-Language: fwrite( &record, sizeof(struct myStructure), 1, fp );
Is there any function in PHP which can store data in chunks of data-structure and then retrieve it in data structure format?