Verify a string contains only integer value in PHP

This is an example on how to verify a string only contains integer values. String may contain anything like float value, double value, characters etc. This example uses regular expression to check a string contains only int values.

Below is the function which validates a string contains only int values.

Usage Examples

Thanks for your reading.

Soumitra

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.