How can I save a $ _session variable in an array?

0

I would like to ask how I could save the variable session in an array, I was trying not to add the variable to an array

<?php
session_start();
$array1 = file("ids.txt");
$test = array_push($array1, $_SESSION['u_id']);
file_put_contents("ids.txt", implode( PHP_EOL, $test));
    
asked by Richard Hasgton 29.11.2017 в 02:09
source

1 answer

-1

Code:

$array = array('dato' => $_SESSION['u_id']);
    
answered by 29.11.2017 в 03:58