I have a lot of php
file.
To access each php
I am using parameter.
Example : index.php?route=changepassword
, index.php?route=aboutus
, etc
I have a route.php
to link the parameter to the correct file
Its better to use
If-Else statement
$route = $_GET['route'];
if ($route==changepassword) {
//statement
} else if ($route==aboutus) {
//statement
}
of using switch-case
?
$route = $_GET['route'];
switch ($route) {
case "changepassword" :
//statement
break;
case "aboutus" :
//statement
break;
}
This is just 2 file, I have 10+ file, it is better to use what?