無料スクリプト配布のPHP.TO   PHPの実用的なtips PHPマニュアル MySQLマニュアル Apacheマニュアル PostgreSQLマニュアル マニュアル検索    

str_word_count

(PHP 4 >= 4.3.0, PHP 5)

str_word_count ???????

mixed str_word_count ( string $string [, int $format = 0 [, string $charlist ]] )

string ?? ? format ???? ??? format ?????? ? format ?? format ????? ???

????'' ???? ???????????? "'" "-" ??????

??

string

?

format

????????? ???

  • 0 - ??
  • 1 - string ?? ??
  • 2 - ???string ? ???????

charlist

'' ????????

?

? format ??????

?

5.1.0 charlist ????

1 str_word_count()

<?php

$str 
"Hello fri3nd, you're
       looking          good today!"
;

print_r(str_word_count($str1));
print_r(str_word_count($str2));
print_r(str_word_count($str1'3'));

echo 
str_word_count($str);

?>

??????

Array
(
    [0] => Hello
    [1] => fri
    [2] => nd
    [3] => you're
    [4] => looking
    [5] => good
    [6] => today
)

Array
(
    [0] => Hello
    [6] => fri
    [10] => nd
    [14] => you're
    [29] => looking
    [46] => good
    [51] => today
)

Array
(
    [0] => Hello
    [1] => fri3nd
    [2] => you're
    [3] => looking
    [4] => good
    [5] => today
)

7



powered by SEO.CUG.NET