X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP FILTER_SANITIZE_NUMBER_INT Filter


PHP Filter Reference Complete PHP Filter Reference

Definition and Usage

The FILTER_SANITIZE_NUMBER_INT filter removes all illegal characters from a number.

This filter allows digits and . + -

  • Name: "number_int"
  • ID-number: 519

Example

<?php
$number="5-2+3pp";

var_dump(filter_var($number, FILTER_SANITIZE_NUMBER_INT));
?>

The output of the code will be:

string(5) "5-2+3"


PHP Filter Reference Complete PHP Filter Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook