✏️ 正在编辑: Refatorar.php
路径:
/srv/systems_dir/koruspay/library/Core/Refatorar.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Core_Refatorar { public static function formatarCpf($value) { $filterDigits = new Zend_Filter_Digits(); $value = $filterDigits->filter($value); if ( strlen($value) < 11 ){ $value = '0' . $value; } return trim($value); } public static function formatarCnpj($value) { $filterDigits = new Zend_Filter_Digits(); $value = $filterDigits->filter($value); if ( strlen($value) < 14 ){ $value = '0' . $value; } return trim($value); } public static function removerAcentuacao($value) { $value = strtr($value, 'áàãâéêíóôõúüçÁÀÃÂÉÊÍÓÔÕÚÜÇ', 'aaaaeeiooouucAAAAEEIOOOUUC' ); return $value; } public static function resetCnpj($value) { $value = preg_replace("/[^0-9]/", "", $value); if( strlen($value) == 14 ) return preg_replace("/([0-9]{2})([0-9]{3})([0-9]{3})([0-9]{4})([0-9]{2})/", "$1.$2.$3/$4-$5", $value); else return $value; } public static function resetCpf($value) { $value = preg_replace("/[^0-9]/", "", $value); if( strlen($value) == 11 ) return preg_replace("/([0-9]{3})([0-9]{3})([0-9]{3})([0-9]{2})/", "$1.$2.$3-$4", $value); else return $value; } public static function formatarNumero($value, $digitos = 7) { while ( strlen($value) < $digitos ){ $value = "0" . $value; } return trim($value); } }
💾 保存文件
← 返回文件管理器