문자열 발생 빈도 반환 - int substr_count ( string $haystack , string $needle )
2014. 1. 11. 19:26
- <?php
- $invalue = "nice to meet you too";
- echo substr_count($invalue, "to");
- // 2
- ?>
--------------------------------------------------------------------------------------------
int substr_count ( string $haystack , string $needle [, int $offset = 0 [, int $length ]] )
4. 라인
$haystack문자열에서 $needle문자열과 같은 문자의 발생 빈도의 수를 반환합니다.