<?php


namespace App\Http\Services;


use App\Model\LogModel;
use App\Model\SupplierAddressModel;
use App\Model\SupplierChannelModel;
use App\Model\SupplierContactModel;

class SupplierReceiptService
{
    //判断字符串是否自由数字、英文字母、字符“-”和“()”
    public static function checkAccountNo($str) {
        return preg_match("/^[0-9a-zA-Z\-\(\)]*$/", $str) === 1;
    }

    //字符串保留数字、英文字母、字符“-”和“()”
    public static function transferAccountNo($str) {
        return preg_replace("/[^0-9a-zA-Z\-\(\)]/", "", $str);
    }

    public static function keepOnlyDigitsAndHyphen($str) {
        return preg_replace("/[^0-9\-]/", "", $str);
    }
}