How to check value 0?

Hi all, I write a router but if in the address bar to drive 0 it will be revnostno NUll or ""
how can I check for 0?

the code which get the title
$routes[0] - responds to null as if entered 0 and back

$url_path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
 $routes = explode('/', trim($url_path, ' /'));
 if ( !empty($routes[0]) ) $a = mb_strtolower(urldecode($routes[0]));
 if ( !empty($routes[1]) ) $b = mb_strtolower(urldecode($routes[1]));
 if ( !empty($routes[2]) ) $c = $routes[2];
July 2nd 19 at 17:20
2 answers
July 2nd 19 at 17:22
Solution
if(isset($routes[0]) && strlen($routes[0])) ...
Thanks, I'm all head broke already - judy_Johns commented on July 2nd 19 at 17:25
July 2nd 19 at 17:24
if ($routes[0]!==false) {...}

Find more questions by tags PHP