W
W
weranda2018-02-12 11:19:44
PHP
weranda, 2018-02-12 11:19:44

How to correctly write and read an array to / from a file?

I greet
you with the familiar array:

$array = array(
    "foo" => "bar",
    "bar" => "foo",
);

How to correctly write an array to a file and read it from there so that it is immediately an array? Is it possible to somehow do this without iterating over the values ​​so that it immediately becomes an array in PH?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav B, 2018-02-12
@weranda

serialize and unserialize

A
Alexander Aksentiev, 2018-02-12
@Sanasol

var_export

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question