<?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;
    }


}
