Skip to content

Instantly share code, notes, and snippets.

@xabbuh
Last active August 29, 2015 14:10
Show Gist options
  • Save xabbuh/98155708898ceeff32c1 to your computer and use it in GitHub Desktop.
Save xabbuh/98155708898ceeff32c1 to your computer and use it in GitHub Desktop.
<?php
// get the old stored value from the session
$modeloMarcaProductoArr = $session->get('modeloMarcaProductoId');
// add a new entry to the array
$modeloMarcaProductoArr[$marca->getId().'-'.$modelo->getId()] = $modeloMarcaProducto->getId();
// write this array back into the session
$session->set('modeloMarcaProductoId', $modeloMarcaProductoArr);
// later on, retrieve the values stored in the session
$modeloMarcaProductoArr = $session->get('modeloMarcaProductoId');
var_dump($modeloMarcaProductoArr['1-3']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment