What is the usage of filter_id() in php is that just an integer?
for example:
echo(filter_id("validate_email"));
it just return an integer. i search a lot(i mean not really) and i cant find any answers.
What is the usage of filter_id() in php is that just an integer?
for example:
echo(filter_id("validate_email"));
it just return an integer. i search a lot(i mean not really) and i cant find any answers.
There are filter functions using filter ids to validate (filter) variables. For example filter_var function:
<?php
$filterId = filter_id('validate_email');
$isEmail = filter_var('user@example.com', $filterId);
var_dump($isEmail); // output: user@example.com
$isNotEmail = filter_var('some text', $filterId);
var_dump($isNotEmail); // output: false