redenumire functie cui
redenumire functie cui

--- a/php/cnp.php
+++ b/php/cnp.php
@@ -18,13 +18,13 @@
 
 $cnp = "2851210278792";
 
-if ( calcCNP ( $cnp ) ) {
+if ( verificaCNP ( $cnp ) ) {
     echo $cnp." e valid";
 } else {
     echo $cnp." e invalid";
 }
 
-function calcCNP ($cnp) {
+function verificaCNP ($cnp) {
     if ( strlen ($cnp) != 13 ) {
         return false;
     }

--- a/php/cui.php
+++ b/php/cui.php
@@ -1,6 +1,14 @@
 <?php 
 
-function isCui ($cif) {
+$cui = "2864518";
+
+if ( verificaCui ( $cui ) ) {
+    echo $cui." e valid";
+} else {
+    echo $cui." e invalid";
+}
+
+function verificaCui ($cif) {
     if (!is_numeric($cif)) return false;
     if ( strlen($cif)>10 ) return false;
     $cifra_control=substr($cif, -1);

comments