I am a beginner to php and i have some trouble with the explode() function.
if (isset($_GET["url"])) {
$url = $_GET["url"];
$url = explode("/", $url);
echo $url;
$controller = $url[0];
$action = $url[1];
} else {
$controller = "pages";
$action = "home";
}
I am typing in the url "localhost/pages/home" and the echo is just printing "Array" as if it's empty. If i echo the $url before using the explode function it comes out as "pages/home". Thanks in advance.