PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Jaroslaw Miazga   myCPF   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example of using
Class: myCPF
Generate and validate Brazilian CPF codes
Author: By
Last change: none
Date: 14 years ago
Size: 333 bytes
 

Contents

Class file image Download
require 'myCPF.php';

/*
How to use:
 
1) If you have to generate new CPF code:


*/

$code = new myCPF();
$code->generate();
echo $code->display();

/*
2) If you have to validate entered CPF code:
*/

$code = new myCPF(12462195107);
if($code->validate())
{
     echo 'valid';
}
else
{
     echo 'invalid';
}