filter_var_array

Pozdrav tražim nekakav tutorial za filter_var_array ‘form validation’ da je malo detaljniji od ovog PHP filter_var_array() Function i npr. kako bi mogao provjerit preko is_null dal’ je value empty ili ne

:strumpf:

$arr = array
  (
  "name" => "peter griffin",
  "age" => "41",
  "email" => "peter@example.com",
  );

$filters = array
  (
  "name" => array
    (
    "filter"=>FILTER_CALLBACK,
    "flags"=>FILTER_FORCE_ARRAY,
    "options"=>"ucwords"
    ),
  "age" => array
    (
    "filter"=>FILTER_VALIDATE_INT,
    "options"=>array
      (
      "min_range"=>1,
      "max_range"=>120
      )
    ),
  "email"=> FILTER_VALIDATE_EMAIL,
  );

kako npr u “email” stavit array da bude više filtera

kako npr u “email” stavit array da bude više filtera:

“email”=> array
(
//sta vec zelis
)

ovdje imas tipove filtera:
PHP: Types of filters - Manual

daklem,

'email' => array(
  'filter' => array(
    FILTER_VALIDATE_EMAIL,
    FILTER_SANITIZE_STRING
  )
)

nefunkcionira,

'email' => array(FILTER_VALIDATE_EMAIL, FILTER_SANITIZE_STRING)

isto ne


Copyright © 2020 WM Forum - AboutContact - Sponsored by: Mydataknox & Webmaster.Ninja