<?php $bookshelf = array( array( array( 'author' => 'Л. Толстый', 'title' => 'Война и пир', 'year' => 2005, ), array( 'author' => 'Н. Гоголь-Моголь', 'title' => 'Мертвые уши', 'year' => 2005, ), ), array( array( 'author' => 'Г. Велс', 'title' => 'Машина Бремени', 'year' => 2009, ), array( 'author' => 'Э. Дерроуз', 'title' => 'Нарзан', 'year' => 1994, ), ), ); $bookshelf[] = 'SuperPuper'; object2file($bookshelf, 'array.txt'); It is necessary to write to the file and read from the file of this array, I'm just learning.