░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
lon105.truehost.cloud
LOCATION:
/home/ilrtztmy/mandariconstructionsupplies.com/api/helpers
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: validate.php
<?php // helpers/validate.php // Basic input validation functions function validate_required(string $field, string $value, array &$errors): void { if (empty(trim($value))) { $errors[$field] = ucfirst($field) . " is required."; } } function validate_email(string $field, string $value, array &$errors): void { if (!filter_var($value, FILTER_VALIDATE_EMAIL)) { $errors[$field] = "Invalid email format."; } } function validate_min_length(string $field, string $value, int $minLength, array &$errors): void { if (strlen($value) < $minLength) { $errors[$field] = ucfirst($field) . " must be at least {$minLength} characters long."; } } function validate_max_length(string $field, string $value, int $maxLength, array &$errors): void { if (strlen($value) > $maxLength) { $errors[$field] = ucfirst($field) . " cannot exceed {$maxLength} characters."; } } function validate_enum(string $field, string $value, array $allowedValues, array &$errors): void { if (!in_array($value, $allowedValues)) { $errors[$field] = ucfirst($field) . " has an invalid value. Allowed values are: " . implode(", ", $allowedValues) . "."; } } function validate_numeric(string $field, $value, array &$errors): void { if (!is_numeric($value)) { $errors[$field] = ucfirst($field) . " must be a numeric value."; } } function validate_url(string $field, string $value, array &$errors): void { if (!filter_var($value, FILTER_VALIDATE_URL)) { $errors[$field] = "Invalid URL format."; } } // More complex validation functions can be added as needed, e.g., for arrays, JSON, etc.
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📄 response.php
PHP
651 B
2026-07-02 10:29
EDIT
📄 slugify.php
PHP
615 B
2026-07-02 10:29
EDIT
📄 validate.php
PHP
1.6 KB
2026-07-02 10:29
EDIT