public function saveJSONArray($jsonValue, $jsonName = NULL)
    {
        $jsonArray = json_decode($jsonValue);

        if ((bool) $jsonName) { //If I want save all array in session I send the name of the array in session
            $this->setVar($jsonName, $jsonArray);
        } else {//I save each value in session
            foreach ($jsonArray as $varName => $value) {
                $this->setVar($varName, $value);
            }
        }
    }
public function saveJSONArray($jsonValue, $jsonName = NULL)
    {
        $jsonArray = json_decode($jsonValue);

        if ((bool) $jsonName) { //If I want save all array in session I send the name of the array in session
            $this->setVar($jsonName, $jsonArray);
        } else {//I save each value in session
            foreach ($jsonArray as $varName => $value) {
                $this->setVar($varName, $value);
            }
        }
    }
public function saveJSONArray ( $ jsonValue , $ jsonName = NULL ) { $ jsonArray = json_decode ( $ jsonValue ) ; if ( ( bool ) $ jsonName ) { //If I want save all array in session I send the name of the array in session $ this -> setVar ( $ jsonName , $ jsonArray ) ; } else { //I save each value in session foreach ( $ jsonArray as $ varName => $ value ) { $ this -> setVar ( $ varName , $ value ) ; } } }
Save a JSON array in session

@param string $jsonValue
@param string $jsonName
@return void
Save a JSON array in session