dimanche 4 février 2018

Issue with if else statement [duplicate]

This question already has an answer here:

can i ask i have some issue with the basic if else elseif statement, for my scenario, if $status is pending, it will display pending, if $status is blank, it will display pending, if $status is not received, it will display not received. For my case, all those that is pending is still displayed as not received, can anyone help me with this problem? thank you so much.

        if (empty($status))
    {
        $status = 'Pending';
    }
    else if ($status = "Not Received")
    {
        $status = 'Not Received';
    }

    else if ($status = "Pending")
    {
        $status = 'Pending';
    }

    echo "Status: $status";




Aucun commentaire:

Enregistrer un commentaire