Avatar

questions about comparisions in the PHP code base (Technics)

by Auge ⌂ @, Monday, February 05, 2018, 17:47 (198 days ago) @ danielb987

Hello

Please bear in mind, that the use of $_REQUEST is not the normal behaviour even it is present at several places. On most places the checks performs explicitely against $_GET or $_POST (or what else) to ensure the source of the variables. IMHO this has a better readability than $_REQUEST but also a better readability than a function (without a parameter to specify way of the incoming data) because in the code I can see the designated source of the data.

$foo = (!empty($_GET['bar'])) ? trim($_GET['bar']) : NULL; // ahhh, an URL-parameter

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!


Complete thread:

 RSS Feed of thread

powered by my little forum