<script>

function test()
{
	alert("TEST");
}

</script>

<?php

			session_start();
			
			// On detruit les variables de notre session  
			session_unset ();  
			//On detruit notre session  
			session_destroy ();  
    
			
			$etat_connexion = array("checkbox1" => "true", "checkbox2" => "true", "checkbox3" => "true");
			$_SESSION['etat_connexion'] = $etat_connexion;
			
			$_SESSION['etat_connexion']['checkbox2'] = "sff";
			
			echo "<pre>";
			print_r($_SESSION);
			
			
			$etat_connexion = array("checkbox1" => "true", "checkbox2" => "true", "checkbox3" => "true");
			
			$etat_connexion["checkbox2"] = "toto";
			
			print_r($etat_connexion);
			
			
			// la cle existe
			if( array_key_exists("checkbox52", $_SESSION['etat_connexion']) )
			{
				echo "bingo";
			}
			else
			{
				echo "nada";
			}
			
			
			array_push($_SESSION['etat_connexion'], "checkbox25","patoche"); 
			
			$second_array = array('name3'=>'value3'); 
			$_SESSION['etat_connexion'] = array_merge($_SESSION['etat_connexion'],$second_array );
			//array_push($_SESSION['etat_connexion'], array("checkbox25"=>"patoche")); 
			print_r($_SESSION);
			
			
			
	
		
?>



<input type="checkbox" name="food[]" value="apple" />fgetc
<input type="checkbox" name="food[]" value="pear" />df	
<input type="checkbox" name="food[]" value="banana" />654

<input type="submit" value="Envoyer" onclick="test();" /> 