PHP code example of uppercod / aduana

1. Go to this page and download the library: Download uppercod/aduana 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/ */

    

uppercod / aduana example snippets



$format = [
   "password" => [
       "type" => "string",
       "minLength" => 6,
       "maxLength" => 20,
       "gual a 6 caracteres",
           "maxLength" => "tu password no debe ser mayor o igual a 20 caracteres",
           "

$shema = [
   "user_email" => [
       "type"=>"email"
   ]
];

$shema = [
   "password" => [
       "minLength" => 6
   ]
];

$shema = [
   "password" => [
       "maxLength" => 12
   ]
];

$shema = [
   "age" => [
       "min" => 18
   ]
];

$shema = [
   "age" => [
       "max" => 30
   ]
];

$shema = [
   "message_1" => [
       "stripTags" => true
   ],
   "message_2" => [
       "stripTags" => "<p>"
   ]
];

$shema = [
   "tag" => [
       "pattern"=>"/[a-z]+/"
   ]
];

$shema = [
   "tag_1" => [
       "replace"=>["/[\.]+/", "_"]
   ],
   "tag_2" => [
       "replace"=>[".", "_"]
   ]
];

$shema = [
   "message" => [
       "cleanSpace"=>true
   ]
];

$shema = [
   "field_1" => [
       "option" => [
           1,2,3,4
       ]
   ]
];

$shema = [
   "field_1" => [
       "alias" => [
           "a"=>1,
           "b"=>2,
           "c"=>3,
       ]
   ]
];

$shema = [
   "hour" => [
       "date" => "h:i:s A"
   ]
];

$shema = [
   "html" => [
       "htmlEncode" => true
   ]
];

$shema = [
   "html" => [
       "htmlDecode" => true
   ]
];

$shema = [
   "html" => [
       "equal" => 10
   ]
];

$shema = [
   "html" => [
       "notEqual" => 10
   ]
];

$shema = [
   "price" => [
       "numberFormat" => [ 0 , ".",","]
   ]
];

$shema = [
   "price" => [
       "range" => ["a","b"]
   ]
];

$shema = [
   "price" => [
       "round" => true
   ]
];

$shema = [
   "price" => [
       "force" => "integer"
   ]
];

$shema = [
   "price" => [
       "quotemeta" => true
   ]
];

$shema = [
   "price" => [
       "callback" => function ($value) {
           return (object) [
               "valid" => true,
               "value" => $value
           ];
       }
   ]
];