/ Published in: PHP
devuelve 4 digitos de los puntos
Expand |
Embed | Plain Text
private function getCode($s, $flag = false) { $retorno = ''; $temp; $n; if (!$s || $s == '' || self::hasLetters($s) || $flag) { $retorno = '29871'; } else { if ($n > 9) { $temp = (string)$n; $n = (int)$temp[0] + (int)$temp[1]; } $retorno .= (string)$n; $n = 0; $temp = $s; { $n += (int)$temp[$i]; } if ($n > 9) { $temp = (string)$n; $n = (int)$temp[0] + (int)$temp[1]; } if ($n > 9) { $temp = (string)$n; $n = (int)$temp[0] + (int)$temp[1]; } $retorno .= (string)$n; { $retorno .= '9'; } else { { $retorno .= '7'; } { $retorno .= '3'; } else { $retorno .= '5'; } } } return $retorno; } private function hasLetters($s) { { { return true; } } return false; }
You need to login to post a comment.
