Store object on file PHP


Description
Stores an object to a file.


$str = serialize( $anObject );
file_put_contents( 'theFile.txt', $str );

$str = file_get_contents( 'theFile.txt' );
$anObject = unserialize( $str );

SEE ALSO