in my php file i currently have this $number = basename('http://'.$_SERVER['HTTP_HOST'].($_SERVER['REQUEST_URI'] == '/' ? 1 : $_SERVER['REQUEST_URI'])); currently, if someone go to http://mypage.com/1 $number becomes 1, or any other number they type in. How can i do it so that if they go to http://mypage.com only $number becomes 1 automaticly?
$number = basename('http://'.$_SERVER['HTTP_HOST'].($_SERVER['REQUEST_URI'] != 1 ? 1 : $_SERVER['REQUEST_URI'])); PHP:
did not work :/ it sets everyting to 1 now, on http://mypage.com/22 $number becomes 1 when i print it.
$number = basename('http://'.$_SERVER['HTTP_HOST'].($_SERVER['REQUEST_URI'] == '/' || trim($_SERVER['REQUEST_URI']) == '' ? 1 : $_SERVER['REQUEST_URI'])); PHP: