PHP code example of jsnlib / validation

1. Go to this page and download the library: Download jsnlib/validation library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jsnlib / validation example snippets


function my($param)
{
    if (\Jsnlib\Validation::no_input($param->age))
        throw new \Exception("缺少參數 age");
}

\Jsnlib\Validation::input($data)
\Jsnlib\Validation::input($data, ['string_empty' => false])

\Jsnlib\Validation::no_input($data)
\Jsnlib\Validation::no_input($data, ['string_empty' => false])