Switch Alternative to php

Asked

Viewed 15 times

0

Alternative to switch in php 7

switch($array["status"]) {
      case '1': 
        $status = "Aguardando pagamento";
        break;
      case '2':
        $status = "Em análise";
        break;
      case '3':
        $status = "Paga";
        break;
      case "4":
        $status = "Disponível";
        break;
      case "5":
        $status = "Em disputa";
        break;
      case "6":
        $status = "Devolvida";
        break;
      case "7":
        $status = "Cancelada";
        break;
    }
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.