public function phone_number_old_and_new($my_number = '', $my_format = NULL)
    {
        if (empty($my_number)) {
            return NULL;
        }
        try {
            $old_number = $this->phone_number_convert($my_number, 'old', $my_format);
            $new_number = $this->phone_number_convert($my_number, 'new', $my_format);
            if ($old_number != $new_number) {
                // Nếu sau khi so sánh convert số cũ và số mới khác nhau -> trả về 1 array
                $result = [
                    $old_number,
                    $new_number
                ];
                $this->_debug->info(__FUNCTION__, 'Result: ' . $result);

                return $result;
            } else {
                // Nếu không khác, trả về string
                $result = $this->format($my_number, $my_format);
                $this->_debug->info(__FUNCTION__, 'Result: ' . $result);

                return $result;
            }
        }
        catch (\Exception $e) {
            $message = 'Error File: ' . $e->getFile() . ' - Line: ' . $e->getLine() . ' - Code: ' . $e->getCode() . ' - Message: ' . $e->getMessage();
            $this->_debug->error(__FUNCTION__, $message);

            return $my_number;
        }
    }
public function phone_number_old_and_new($my_number = '', $my_format = NULL)
    {
        if (empty($my_number)) {
            return NULL;
        }
        try {
            $old_number = $this->phone_number_convert($my_number, 'old', $my_format);
            $new_number = $this->phone_number_convert($my_number, 'new', $my_format);
            if ($old_number != $new_number) {
                // Nếu sau khi so sánh convert số cũ và số mới khác nhau -> trả về 1 array
                $result = [
                    $old_number,
                    $new_number
                ];
                $this->_debug->info(__FUNCTION__, 'Result: ' . $result);

                return $result;
            } else {
                // Nếu không khác, trả về string
                $result = $this->format($my_number, $my_format);
                $this->_debug->info(__FUNCTION__, 'Result: ' . $result);

                return $result;
            }
        }
        catch (\Exception $e) {
            $message = 'Error File: ' . $e->getFile() . ' - Line: ' . $e->getLine() . ' - Code: ' . $e->getCode() . ' - Message: ' . $e->getMessage();
            $this->_debug->error(__FUNCTION__, $message);

            return $my_number;
        }
    }
public function phone_number_old_and_new ( $ my_number = '' , $ my_format = NULL ) { if ( empty ( $ my_number ) ) { return NULL ; } try { $ old_number = $ this -> phone_number_convert ( $ my_number , 'old' , $ my_format ) ; $ new_number = $ this -> phone_number_convert ( $ my_number , 'new' , $ my_format ) ; if ( $ old_number != $ new_number ) { // Nếu sau khi so sánh convert số cũ và số mới khác nhau -> trả về 1 array $ result = [ $ old_number , $ new_number ] ; $ this -> _debug -> info ( __FUNCTION__ , 'Result: ' . $ result ) ; return $ result ; } else { // Nếu không khác, trả về string $ result = $ this -> format ( $ my_number , $ my_format ) ; $ this -> _debug -> info ( __FUNCTION__ , 'Result: ' . $ result ) ; return $ result ; } } catch ( \ Exception $ e ) { $ message = 'Error File: ' . $ e -> getFile ( ) . ' - Line: ' . $ e -> getLine ( ) . ' - Code: ' . $ e -> getCode ( ) . ' - Message: ' . $ e -> getMessage ( ) ; $ this -> _debug -> error ( __FUNCTION__ , $ message ) ; return $ my_number ; } }
Function phone_number_old_and_new - Get Phone Number Old and New

@author: 713uk13m <dev@nguyenanhung.com>
@time  : 9/28/18 13:39

@param string $my_number
@param null   $my_format

@return array|mixed|null|string
@throws \Exception
Function phone_number_old_and_new - Get Phone Number Old and New