lightsource/data-types

根据类型进行复杂数据清理的类

4.0.5 2023-04-04 11:01 UTC

This package is auto-updated.

Last update: 2024-09-04 13:50:36 UTC


README

Latest Stable Version Total Downloads Monthly Downloads Daily Downloads License

这是什么

根据类型进行复杂数据清理的类

安装

composer require lightsource/data-types

使用示例

use LightSource\DataTypes\DATA_TYPES;
use LightSource\StdResponse\STD_RESPONSE;

require_once __DIR__ . '/vendor/autoload.php';

$result = DATA_TYPES::Clear( DATA_TYPES::INT, '10', [
	DATA_TYPES::_MIN => 1,
	DATA_TYPES::_MAX => 20,
] );

if ( $result[ STD_RESPONSE::IS_SUCCESS ] ) {
	$value = $result[ STD_RESPONSE::ARGS ][ DATA_TYPES::_ARG__VALUE ];
	// TODO
} else {
	$errorMsgs = $result[ STD_RESPONSE::E_MSGS ];
	// TODO
}