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 Roy Sarkar

I am a professional Web developer, Enterprise Application developer, Software Engineer and Blogger. Connect me on Twitter Facebook  Google Plus Linkedin

Leave a Reply

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