×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Fabian Constien
Added: Nov 5, 2017 7:59 PM
Modified: Nov 5, 2017 9:57 PM
Views: 3
Tags: no tags
  1. if (ctype_digit($var)) {
  2.     echo 'nur ziffern';
  3. }
  4.  
  5. ggf. besser
  6. if ((is_string($var) AND ctype_digit($var)) OR (!is_string($var) AND is_int($var))) {
  7.     echo 'nur ziffern bzw. zahl';
  8. }