These can be variables, constants, or expressions. The third and subsequent arguments are optional, and contain the values to be inserted into the format string. This can contain format specifiers similar to those in printf(). The second argument, $format, is the format string. This can be a file handle, network socket, or any other stream resource created by fopen() or fsockopen(). The first argument, $handle, is the stream to which the string will be written. Syntax: fprintf ( resource $handle, string $format ] ) : int|false It returns the number of characters written, or false on error. The PHP string function fprintf() writes a formatted string to a specified stream. When mode is 4, function returns an array with the ASCII value of each character not used as an index, but only includes characters not used in the string.Ĭount_chars() example $string = "Hello, World!" $uniqueCharacters = count_chars ( $string, 0 ) $countCharacters = count_chars ( $string, 1 ) $charFrequency = count_chars ( $string, 2 ) `Įcho "Unique characters: ".When mode is 3, function returns an array with the ASCII value of each character used as an index, but only includes characters used in the string.When mode is 2, function returns an array with the ASCII value of each character used as an index, and the frequency of the character appearing in the string as a value.When mode is 1, function returns an array with the ASCII value of each character used as an index, and the count of the character appearing in the string as a value.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |