$array = [1, 2, 3]; $string = serialize( $array ); $array = unserialize( $string ); // http://ruseller.com/lessons.php?rub=37&id=699