This commit is contained in:
20
api/app/Utils/Format.php
Normal file
20
api/app/Utils/Format.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user