Miscellaneous in PHP

This tutorial will show you some validations we require in most of the cases. These are given below one by one.

1. Check if an email address is injected

2. Check if an email address is valid

3. Check if a decimal number takes upto two decimal places

4. Check the value is numeric

5. Check if value is integer

6. Clean input value

7. Remove HTML from a string value

8. Insert new line

9. Remove misinterpreted HTML from a string value

10. Escape terminating character

11. Remove slash from the string value

12. Remove white spaces from both side of the string value

13. Remove slashes from the string value

14. Remove all white spaces from the string value

15. Calculate length of a string

16. Encrypt a value using md5 algorithm

17. Validate web URL

18. Zip or Pin code validation

19. Validate name should contain letters

20. Retrieve extension from file name

21. Compare two string case sensitive

22. Compare two string case insensitive

23. Validate GET parameter query string in URL

24. Validate alphanumeric with minimum and maximum range

25. Prevent XXS attacks when user provides input to the form

That’s all. Thanks for reading.


Software Professional, I am passionate to work on web/enterprise application. For more information please go to about me. You can follow on Twitter. You can be a friend on Facebook or Google Plus or Linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.