hey guys , im writing a class and im wondering how i can write a condition statement in this way :
$this->referer= (!empty($_SERVER['HTTP_REFERER'])) ? htmlspecialchars((string) $_SERVER['HTTP_REFERER']) : '';
i need to find my user_id and this is the usual condtion :
if(is_user($user)){
$cookie=cookiedecode($user);
$user_id=intval($cookie[0]);
}
and i think it should be something like this :
$this->user_id = (is_user($user)) ? (cookiedecode($user)) : $cookie[0];
but it didnt work