mulertech/char-manipulation
最新稳定版本:v1.0.4
Composer 安装命令:
composer require mulertech/char-manipulation
包简介
This class manipulates characters
README 文档
README
This class manipulates characters
Installation
Two methods to install Application package with composer :
Add to your "composer.json" file into require section :
"mulertech/char-manipulation": "^1.0"
and run the command :
php composer.phar update
Run the command :
php composer.phar require mulertech/char-manipulation "^1.0"
Usage
specialCharsTrim, trim and convert special characters to HTML entities :
CharManipulation::specialCharsTrim(' Test trim ');
// 'Test trim'
CharManipulation::specialCharsTrim('<script\>Test without html balise</script>');
// 'Test without html balise'
CharManipulation::specialCharsTrim([' Test "trim"', '<script\>with</script>', ' array ', ' and', 'null ', null]);
// ['Test "trim"', 'with', 'array', 'and', 'null', null]
specialCharsDecode (decode chars into string or array by reference, no return) :
$test = ''test single quote';
CharManipulation::specialCharsDecode($test);
// echo $test;
// "'test single quote";
$test = [
'test1' => ''test single quote',
'test2' => 'test quote"',
'test3' => 'with null',
'test4' => null,
'test5' => [
'test5a' => "'test single quote",
'test5b' => 'test quote"',
'test5c' => 'with null',
'test5d' => null
]
];
CharManipulation::specialCharsDecode($test);
// echo $test;
// [
'test1' => "'test single quote",
'test2' => 'test quote"',
'test3' => 'with null',
'test4' => null,
'test5' => [
'test5a' => "'test single quote",
'test5b' => 'test quote"',
'test5c' => 'with null',
'test5d' => null
]
];
统计信息
- 总下载量: 461
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-31