| Start | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Validate Email Address When filtering an email address Results: This function doesn't validate not-latin characters. Internationalized domain name can be validated in their Note that you cannot know if the email address is correct before sending an email to it. You may want to do some extra checks such as checking for a MX record, but this is not necessary. If you send a confirmation email, don't forget to remove unused accounts after a short period. |
||||||||||||
| Validating A Value Is An Integer When filtering a value that should be an integer Results: If you are expecting only digits, you can use a regular expression: If you convert this value into an integer, you don't have to do this check and so you can use |
||||||||||||
| Validating An Integer Falls In A Range When validating that an integer falls in a range the check includes the minimum and maximum bounds: Results: |
||||||||||||
| Validate a URL When filtering a URL URL: Results: URL: Results: URL: Results: URL: Results: URL: Results: URL: Results: Warning: You must check the protocol to protect you against an XSS attack: |
||||||||||||
| Sanitize filters we can use filters to sanitize our variable according to our need. Example above will remove the html tags from |
||||||||||||
Validating Boolean Values |
||||||||||||
| Validating A Number Is A Float Validates value as float, and converts to float on success. Results |
||||||||||||
| Validate A MAC Address Validates a value is a valid MAC address Results: |
||||||||||||
| Sanitze Email Addresses Remove all characters except letters, digits and !#$%&'*+-=?^_`{|}~@.[]. Results: |
||||||||||||
| Sanitize Integers Remove all characters except digits, plus and minus sign. Results: |
||||||||||||
| Sanitize URLs Sanitze URLs Remove all characters except letters, digits and $-_.+!*'(),{}|^~[]`<>#%";/?????&= Results: |
||||||||||||
| Sanitize Floats Remove all characters except digits, +- and optionally .,eE. Results: With the Results: With the Results: |
||||||||||||
| Validate IP Addresses Validates a value is a valid IP address Results: Validate an valid IPv4 IP address: Results: Validate an valid IPv6 IP address: Results: Validate an IP address is not in a private range: Results: Validate an IP address is not in a reserved range: Results: Syntax
Parameters
|
Read Article
https://develop.horje.com/learn/1434/reference