[Solved] How to set array data posted as dropdown list in key value format [closed]


$array_list=array(array("value"=>0,"text"=>"--Select--"),array("value"=>268,"text"=>"Cash received"));

$selected=268;
$text="";
foreach($array_list as $entry){
    if($entry['value']==$selected){
        $text=$entry['text'];
        break;
    }
}

echo "Selected Option: ".$text;

Text will now contain the selected option, if I understood your question correct.

4

solved How to set array data posted as dropdown list in key value format [closed]