ABooooo
8/19/2014 - 7:23 AM

Read URL and create array after slash

Read URL and create array after slash

<?php 

$str = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";

$res = array_filter(explode("/", $str));
//echo $res[0];

if ($res[0] == "condition") {
	
	// do something
	
}

?>