check url if it has trailing slash

Solutions on MaxInterview for check url if it has trailing slash by the best coders in the world

showing results for - "check url if it has trailing slash"
Thor
26 Jul 2020
1$getWholeUrl = "http://".$_SERVER['HTTP_HOST']."".$_SERVER['REQUEST_URI']."";
2
3//The output would be 
4/*
5  http://localhost/tabulation/event/event_name/
6*/
7
8if(substr($getWholeUrl , -1)=='/'){
9    //Add your condition here
10
11}