mercredi 17 avril 2019

How to urldecode PHP Laravel or PHP Lumen route query parameter?

English characters work when I pass it as query parameter but not Arabic characters.

This works:

http://127.0.0.1:8000/terms/search/found

Terminal Log:

http://127.0.0.1:8000/terms/search/found

This does not:

http://127.0.0.1:8000/terms/search/حو

Terminal Log:

http://127.0.0.1:8000/terms/search/%D8%AD%D9%88

PHP Route:

$router->group(['prefix' => 'terms'], function () use ($router) {
    $router->get('', 'TermController@index');
    $router->get('/search/{term}', 'TermController@search');
});

How can I use urldecode PHP method on the route or is there any workaround for this situation?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire