PHP fonksiyon argüman hatası kaçırdı?

0 Cevap php

In PHP I allow the user to enter a url and load a file, function, parameters accordingly with a simple routing file.

A Url of http://localhost/user/edit/1 will call the file user.php and the function edit() inside it and pass the parameter 1 to it. If the user removed the argument 1 and the preceeding slash so a function missing argument error will appear which I don't like. I tried exception handling like this.

<?php
try {
 call_user_func($action,$params);
} catch (Exception $e) {
 echo "You followed a wrong URL to get to this page";
}
?>

/>
ama bu işe yaramazsa ve php uyarı görünecektir. Bunu nasıl gizleyebilirsiniz?

0 Cevap