Do you know of a function that can check if a string contains an integer?
Here\'s how I\'d expect it to work:
holds_int(\"23\") // should return true
If you use Assert library in you project (https://github.com/beberlei/assert) you can easily do it in one line:
Assertion::integerish($var);
Note: it throws an exception in case of violation the assertion.