renane labels of $_SESSION vars

Hello everybody, I am working now in the vars $_SESSION, I have a file .txt and read the vars of the file that the way

$archivo=fopen(‘C:url’);
$con=0;
$var[]=0;
$variables[]=0;

if ($archivo){
while(!feof($archivo)){
$con=$con+1;
$linea=fgets($archivo,255);
$var=explode("=",$linea);
$variables[$con]=$var[1];
}
}
fclose($archivo);
$_SESSION[‘sid’]=$variables;

the code read de values perfect on the file .txt but by default name of the field is that for example

sid 0 server
1 bd

when I try set de name of field, create the new cell on the array the vars, how can fixed that, I want set the name of field for example

sid servidor server
database pg_32

sorry my bad english.
good day.

Re: renane labels of $_SESSION vars

You need to do is the association of the key with the value.

if 0 is server
if 1 is databse …

$arr_names = array();
$arr_names[0] = “Server”;
$arr_names[1] = “Database”;
if ($archivo)
{
while(!feof($archivo))
{
$con=$con+1;
$linea=fgets($archivo,255);
$var=explode("=",$linea);
//look here, im changing the code, for the value
//instead that, you could get the value from a table …
$variables[$arr_names[$con]]=$var[1];
}
}

Re: renane labels of $_SESSION vars

yeah, that rigth thank you very much men its work really thanks