I'm working on a MVC project and i'm on the part to get the URL values, to get each param i use array_shift() and the documentation says this:
Returns the shifted value, or NULL if array is empty or is not an array.
In my code i have these lines:
$arrParams = isset($_GET["params"]) ? explode("/", $_GET["params"]) : "";
$controller = array_shift($arrParams);
$action = array_shift($arrParams);
$params = array_shift($arrParams);
If i access to mvc-project.local and i don't pass any param to the URL appears this message:
Warning: array_shift() expects parameter 1 to be array, string given in ... on line 12
Where is the problem?