1. Go to this page and download the library: Download kariricode/sanitizer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kariricode / sanitizer example snippets
// Sprinkled everywhere with no audit trail
$name = ucwords(strtolower(trim($request->name)));
$email = strtolower(trim($request->email));
$cpf = preg_replace('/\D/', '', $request->cpf);
$bio = htmlspecialchars(strip_tags($request->bio));
// No record of what changed, no idempotency guarantee,
// no attribute-driven DTOs, no composition.
use KaririCode\Sanitizer\Contract\SanitizationRule;
use KaririCode\Sanitizer\Contract\SanitizationContext;
final class PhoneRule implements SanitizationRule
{
public function sanitize(mixed $value, SanitizationContext $context): mixed
{
if (!is_string($value)) {
return $value; // ARFA passthrough — do not coerce
}
return preg_replace('/\D/', '', $value) ?? $value;
}
#[\Override]
public function getName(): string
{
return 'phone';
}
}
// Register and use
$registry = (new SanitizerServiceProvider())->createRegistry();
$registry->register('phone', new PhoneRule());
$engine = new SanitizerEngine($registry);
$result = $engine->sanitize(['phone' => '(85) 99999-9999'], ['phone' => ['phone']]);
// → "85999999999"
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.