use RequestCheckUtil\RequestCheckUtil; $password = "abc123@#$"; $max_length = 10; $is_valid = RequestCheckUtil::checkMaxLength($password, $max_length); if (!$is_valid) { echo "Password must be less than or equal to {$max_length} characters long."; }
use RequestCheckUtil\RequestCheckUtil; $email = "johndoe@example.com"; $max_length = 50; $is_valid = RequestCheckUtil::checkMaxLength($email, $max_length); if (!$is_valid) { echo "Email must be less than or equal to {$max_length} characters long."; }Package/Library: RequestCheckUtil