I have the following array,
$status = array();
$status["Visualizar"] = "Visualizar";
$status["Editar"] = "Editar";
$status["Status"] = "Alterar Status";
$status["Boleto"] = "Gerar Boleto";
It turns out that depending on the current status that goes from 1 to 10 I should or should not show the Item $ status ["Status"], as well as if it resolves, but it happens that when I give an unset and then reinsert the item it goes to the end of the list, but I need it to stay in the original position before ticket
Example:
if ($codstatus == 3){
$status["Status"] = "Alterar Status";
}else{
unset($status["Status"]);
}
Is there an elegant way to do this or do I have to redo the entire array every time?