mardi 25 décembre 2018

Variable won't changed in PHP (if !empty)

So i'm trying to change $page_id to 1 if there's empty, but it isn't work, i've been trying using if(empty($page_id)) and flip the if else but still not working.

$page_id=$_GET['page_id'];
    $limit=5;
    $position=null;
        if(!empty($page_id)){
            $position=($page_id-1)*$limit;
        }else{
            $page_id=1;
            $position=0;
        }?>

Aucun commentaire:

Enregistrer un commentaire