update
This commit is contained in:
22
inc/Hura8/System/Security/DataFormatter.php
Normal file
22
inc/Hura8/System/Security/DataFormatter.php
Normal 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user