ParameterHelper

Last updated: August 12th, 2023
Release:

The ParameterHelper class provides some structure to dealing with array-based parameter sets, such as those from super globals like $_GET or $_POST.

Example

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'));
}

Further Reading

Next Up

Continue to read about the SanitationHelper class, or visit the Table of Contents.