Autres filtres

Liste de filtres divers
ID Nom Options Flags Description
FILTER_CALLBACK "callback" Fonction ou méthode de rappel (type callable)   Appelle une fonction utilisateur pour filtrer les données.

add a note add a note

User Contributed Notes 1 note

up
0
thatindividual dot zhang at gmail dot com
1 month ago
Here is an example, since I cannot find one through out php.net"

<?php

/**
* Strip whitespace (or other non-printable characters) from the beginning and end of a string
* @param string $value
*/
function trimString($value)
{
    return
trim($value);
}

$loginname = filter_input(INPUT_POST, 'loginname', FILTER_CALLBACK, array('options' => 'trimString'));
To Top