The ParameterHelper
class provides some structure to dealing with array-based parameter sets,
such as those from super globals like $_GET
or $_POST
.
use Stoic\Utilities\ParameterHelper;
$ph = new ParameterHelper($_POST);
if ($ph->has('someVar')) {
echo($ph->get('someVar')); // retrieves the raw parameter
}
if ($ph->hasAll('stringVar', 'intVar')) {
echo($ph->getString('stringVar'));
echo($ph->getInt('intVar'));
}
Continue to read about the SanitationHelper class, or visit the Table of Contents.