<?php
$str = "Hello friend, you're looking good today!";
$a = str_word_count($str, 1);
$b = str_word_count($str, 2);
$c = str_word_count($str);
print_r($a);
print_r($b);
echo $c;
?>
Array
(
[0] => Hello
[1] => friend
[2] => you're
[3] => looking
[4] => good
[5] => today
)
Array
(
[0] => Hello
[6] => friend
[14] => you're
[29] => looking
[46] => good
[51] => today
)
6'프로그래밍 언어 > php' 카테고리의 다른 글
| 배열 컬럼 정렬 (0) | 2007.03.15 |
|---|---|
| php error func (0) | 2007.03.12 |
| substr_count - 부분 문자열 수를 센다. (0) | 2007.03.11 |
| msec -> 시분초 (0) | 2007.03.02 |
| strtotime - 날짜 변환 (0) | 2007.02.02 |