This commit is contained in:
2025-10-04 11:46:59 +07:00
commit 97427d7cff
498 changed files with 47596 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?php
namespace Hura8\System\Security;
class DataFormatter
{
//remove space, ., ,
//add 84 to 0923232123 -> 84923232123
//dont change 84923232123 -> 84923232123
public static function formatMobile($mobile) {
$mobile = preg_replace("/[^0-9]/i", "", $mobile);
$first_2 = substr($mobile, 0, 2);
if( $first_2 != '84') {
return '84'.substr($mobile, 1);
}
return $mobile;
}
}