Try to get arrays from a file like…
data.txt
Array
(
[0] => 288
[1] => 287
[2] => 173
)
my.php
$data = file('data.txt');
foreach ($data as $id) {
echo $id." - ";
}
Why its echo all arrays back ? like data.txt
Why not echo like 288 – 287 – 173 ?
CLOSED : I using JSON now
When saving your data, get the string representation using
serialize:You can then use
unserializeto decode your array: