I have created a session array in laravel using the code:
Session::put("backUrl", array($workout_id =>URL::previous())) ;
//or
Session::push("backUrl.$workout_id", URL::previous()) ;
Both works and it has been created successfully and I could see it in the debugger
'backUrl' => array(1) [
'78' => string (36) "http://192.241.4.104/admin/view?cs=1"
]
now I am unable to print it, The code i have used is
echo Session::get("backUrl"[$workout_id]);
it shows a syntax error, unexpected '[' error
And I have also used
echo Session::get("backUrl[$workout_id]");
nothing works