source: branches/version-2_5-dev/data/module/Compat/tests/function/str_word_count.phpt @ 20119

Revision 20119, 1004 bytes checked in by nanasess, 13 years ago (diff)

module 以下は svn:keywords を除外

  • Property svn:eol-style set to LF
Line 
1--TEST--
2Function -- str_word_count
3--SKIPIF--
4<?php if (function_exists('str_word_count')) { echo 'skip'; } ?>
5--FILE--
6<?php
7require_once 'PHP/Compat.php';
8PHP_Compat::loadFunction('str_word_count');
9
10$str = "Hello friend, you're \r\nsdf\tlooking    3865\t9879 good to\"day, yes \"sir\" you am!";
11var_dump(str_word_count($str));
12print_r(str_word_count($str, 1));
13print_r(str_word_count($str, 2));
14
15$str = 'hello I am repeated repeated';
16print_r(str_word_count($str, 2));
17?>
18--EXPECT--
19int(12)
20Array
21(
22    [0] => Hello
23    [1] => friend
24    [2] => you're
25    [3] => sdf
26    [4] => looking
27    [5] => good
28    [6] => to
29    [7] => day
30    [8] => yes
31    [9] => sir
32    [10] => you
33    [11] => am
34)
35Array
36(
37    [0] => Hello
38    [6] => friend
39    [14] => you're
40    [23] => sdf
41    [27] => looking
42    [48] => good
43    [53] => to
44    [56] => day
45    [61] => yes
46    [66] => sir
47    [71] => you
48    [75] => am
49)
50Array
51(
52    [0] => hello
53    [6] => I
54    [8] => am
55    [11] => repeated
56    [20] => repeated
57)
Note: See TracBrowser for help on using the repository browser.