fork(1) download
  1. <?php
  2.  
  3. $not_an_int = "sa';';';'sd12340asd";
  4. $actual_int = "12341234";
  5.  
  6. var_dump(filter_var($not_an_int, FILTER_SANITIZE_NUMBER_INT));
  7. var_dump(filter_var($actual_int, FILTER_SANITIZE_NUMBER_INT));
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
string(5) "12340"
string(8) "12341234"