21 lines
418 B
PHP
21 lines
418 B
PHP
<?php
|
|
|
|
namespace App\Utils;
|
|
|
|
class Format
|
|
{
|
|
public static function getProcedimentoFormated($procedimento)
|
|
{
|
|
return preg_replace(
|
|
'/(\d{2})(\d{2})(\d{2})(\d{3})(\d{1})/',
|
|
'$1.$2.$3.$4-$5',
|
|
self::getOnlyDigits($procedimento)
|
|
);
|
|
}
|
|
|
|
public static function getOnlyDigits(&$value)
|
|
{
|
|
return preg_replace('/[^\d]/', '', (string) $value);
|
|
}
|
|
}
|