I need to convert an array into associative array as first element should act as a key and second element should act as its value ?please tell me how i can do that
If you have only two elements (first and second as you mentioned), then you can do simply like this
$assoc = array($simple[0] => $simple[1]);
If you wanted to convert pairs of values like [1,2,3,4] to [1=>2,3=>4], then use this code snippet
$assoc = array();
for ($i = 0; $i < count($simple); $i=$i+2) {
$assoc[$simple[$i]] = $simple[$i+1];
}