文件
xionggeshop/addons/shopro_aliyun_express/library/ExpressSanitizer.php

28 行
618 B
PHP

<?php
namespace addons\shopro_aliyun_express\library;
class ExpressSanitizer
{
/**
* 清理运单号(去除空格、换行等)
*/
public static function waybillNo($value)
{
$value = (string) $value;
$value = preg_replace('/[\s\x{00A0}\x{3000}]+/u', '', $value);
return trim($value);
}
public static function phone($value)
{
return trim(preg_replace('/[\s\x{00A0}\x{3000}]+/u', '', (string) $value));
}
public static function expressCode($value)
{
$value = self::waybillNo($value);
return strtoupper($value);
}
}