Skip to content

Commit

Permalink
Sample for the upcoming new interface, here is the multiple sample usage
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.php.net/repository/pear/packages/Validate/trunk@116718 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
pierrejoye committed Feb 17, 2003
1 parent c19c90f commit 3dfe9ed
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions docs/sample_multiple.php
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);

?>

0 comments on commit 3dfe9ed

Please sign in to comment.