From 52d5d29b8da3830a0ad89eaa9f84d4846274bf7e Mon Sep 17 00:00:00 2001 From: "Thies C. Arntzen" Date: Tue, 14 Dec 1999 04:13:10 +0000 Subject: [PATCH] new fiunction count_chars() git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@17180 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/strings.xml | 47 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/functions/strings.xml b/functions/strings.xml index c0aeea3405..fa3adc5c89 100644 --- a/functions/strings.xml +++ b/functions/strings.xml @@ -150,7 +150,7 @@ $str = sprintf("The string ends in escape: %c", 27); - + chunk_split @@ -230,6 +230,51 @@ $new_string = chunk_split(base64_encode($data)); + + + + count_chars + Return information abouts characters used in a string + + + Description + + mixed count_chars + string string + mode + + + Counts the number of occurances of every byte-value (0..255) in + string and returns it in various ways. + The optional parameter Mode default to 0. Depending on + mode count_chars returns one of the following: + + + 0 - an array with the byte-value as key and the freqency of every byte as value. + + + 1 - same as 0 but only byte-values with a frequency greater zero are listed. + + + 2 - same as 0 but only byte-values with a frequency equal to zero are listed. + + + 3 - a string containing all used byte-values is returned. + + + 4 - a string containing all not used byte-values is returned. + + + + + + This function was added in PHP 4.0. + + + + + + crypt