本文整理汇总了PHP中Formatter::to_digits_and_single_spaces方法的典型用法代码示例。如果您正苦于以下问题:PHP Formatter::to_digits_and_single_spaces方法的具体用法?PHP Formatter::to_digits_and_single_spaces怎么用?PHP Formatter::to_digits_and_single_spaces使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Formatter
的用法示例。
在下文中一共展示了Formatter::to_digits_and_single_spaces方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_filters_and_sanitisers
public function test_filters_and_sanitisers()
{
$this->assertEquals('1234', Formatter::to_digits('&*x 1234 +#cN'));
$this->assertEquals('1 1234 1', Formatter::to_digits_and_single_spaces('&*x1 1234 1+#cN'));
$this->assertEquals('1123.5', Formatter::to_numeric('&*x1 123.x 5+#cN'));
$this->assertEquals('x112341cN', Formatter::to_alphanumeric('&*x1 1234 1+#cN'));
$this->assertEquals('abcABC', Formatter::to_alpha('a 123!"£bcABC!'));
$this->assertEquals('1234 567 890', Formatter::to_phone('(1234 ) 567-890 '));
$this->assertEquals('1994-11-05T08:15:30-05:00', Formatter::to_iso_date('199|£$%ab~+!|4-11-05T08:15:30-05:00'));
$this->assertEquals('12/12/12', Formatter::to_short_date('x12/12/\\$*#12!'));
$this->assertEquals('foo_hoo-Boo', Formatter::to_system_id('foo_hoo|!"£$%^&*()"|-Boo'));
$this->assertEquals('/dir/This_is-MyFile.php', Formatter::to_unix_file_path('/dir/This|#=<>?$&|_is-MyFile.php'));
$this->assertEquals('|###thisisatest!!!|', Formatter::strip_space(' |# ##thi sisatest!!!| '));
$this->assertEquals(' |# ##thi s is a test!| ', Formatter::strip_extra_space(' |# ##thi s is a test!| '));
$this->assertEquals('John De-Groot 14th.', Formatter::strip_nasties('John De|*^<>?!"()|\\/[]|-Groot 14th.'));
$this->assertEquals('xxxxxxxxxxxxxxx', Formatter::strip_markup_tags('<markup>xxxx</markup>xxxx<more markup>xxxxxxx'));
}