-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sample for the upcoming new interface, here is the multiple sample usage
git-svn-id: http://svn.php.net/repository/pear/packages/Validate/trunk@116718 c90b9560-bf6c-de11-be94-00142212c4b1
- Loading branch information
1 parent
c19c90f
commit 3dfe9ed
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
//include_once "Validate/FR.php"; | ||
require_once "Validate.php"; | ||
|
||
if(function_exists('multiple')){ | ||
die('FUCKKK'); | ||
} | ||
/* | ||
test(Validate::creditCard('6762195515061813'), true); | ||
// 4 | ||
test(Validate::creditCard('6762195515061814'), false); | ||
// 5 | ||
*/ | ||
/* | ||
function rib($aCodeBanque, $aCodeGuichet='', $aNoCompte='', $aKey='') | ||
function number($number, $decimal = null, $dec_prec = null, $min = null, $max = null) | ||
*/ | ||
$values = array( | ||
'amount'=> '13234,344343', | ||
'name' => 'foo@example.com', | ||
'rib' => array( | ||
'codebanque' => '33287', | ||
'codeguichet' => '00081', | ||
'nocompte' => '00923458141C', | ||
'key' => '52' | ||
), | ||
'rib2' => array( | ||
'codebanque' => '12345', | ||
'codeguichet' => '12345', | ||
'nocompte' => '12345678901', | ||
'key' => '46' | ||
), | ||
'cc' => '6762195515061813', | ||
'cc2' => '6762195515061814', | ||
'mail' => 'foo@example.com', | ||
'hissiret' => '441 751 245 00016', | ||
'mystring' => 'ABCDEabcde' | ||
); | ||
$opts = array( | ||
'amount'=> array('type'=>'number','decimal'=>',.','dec_prec'=>null,'min'=>1,'max'=>32000), | ||
'name' => array('type'=>'email','check_domain'=>false), | ||
'rib' => array('type'=>'fr_rib'), | ||
'rib2' => array('type'=>'fr_rib'), | ||
'cc' => array('type'=>'creditcard'), | ||
'cc2' => array('type'=>'creditcard'), | ||
'mail' => array('type'=>'email'), | ||
'hissiret' => array('type'=>'fr_siret'), | ||
'mystring' => array('type'=>'string',array('format'=>VAL_ALPHA, 'min_lenght'=>3)) | ||
); | ||
|
||
$result = Validate::multiple($values, $opts); | ||
|
||
print_r($result); | ||
|
||
?> |