PHP count_chars()

1 개요[ | ]

PHP count_chars()
$str = "Hello";
$counts = count_chars($str,1);
foreach($counts as $k=>$v) echo "[$k]=>$v ";
echo "\n";
# [72]=>1 [101]=>1 [108]=>2 [111]=>1 
foreach($counts as $k=>$v) echo chr($k).":$v ";
echo "\n";
# H:1 e:1 l:2 o:1
print_r( count_chars('Hello') );
Array
(
    [0] => 0
    [1] => 0
    [2] => 0
... (생략)
    [107] => 0
    [108] => 2
    [109] => 0
    [110] => 0
    [111] => 1
    [112] => 0
... (생략)
    [254] => 0
    [255] => 0
)

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}