Level 1
This is the syntax: $routes = [ 'test' => 'pages/home.php', 'test/home' => 'pages/home.php', 'test/about' => 'pages/about.php', 'test/contact' => 'pages/contact.php' ]; require $routes[$path];
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello guys, I have a php file name "index.php", I wrote this codes inside:
I place the folder "test" in the folder "htdocs", but when I run it does not work, but if I run using:-
php -S localhost:8080 in the dos prompt it works fine.
Can someone help me why is not working with xampp?
Please or to participate in this conversation.