sebastiansulinski / regex-kit
Regex Kit:专门为简单字符串替换设计的函数
1.0.1
2015-03-02 16:25 UTC
Requires
- php: >=5.4.0
Requires (Dev)
- phpunit/phpunit: 4.7.*@dev
This package is auto-updated.
Last update: 2024-09-05 18:51:36 UTC
README
Regex Kit:专门为简单字符串替换设计的一组方法
用法
示例 1
查找并替换 URI。
use SSD\RegexKit\Factory;
echo Factory::anchor(
'Visit documentation at http://github.com or for more info use http://google.com',
[
'target' => '_blank'
]
);
示例 2
查找并替换 @User
。
use SSD\RegexKit\Factory;
echo Factory::atUser(
'Hey @JohnDoe, thanks for sorting this out!',
'/user/',
[
'target' => '_blank',
'title' => 'View user profile'
]
);