Query: ctype_punct
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
CTYPE_PUNCT(3) 1 CTYPE_PUNCT(3) ctype_punct - Check for any printable character which is not whitespace or an alphanumeric characterSYNOPSISbool ctype_punct (string $text)DESCRIPTIONChecks if all of the characters in the provided string, $text, are punctuation character.PARAMETERSo $text - The tested string.RETURN VALUESReturns TRUE if every character in $text is printable, but neither letter, digit or blank, FALSE otherwise.EXAMPLESExample #1 A ctype_punct(3) example <?php $strings = array('ABasdk!@!$#', '!@ # $', '*&$()'); foreach ($strings as $testcase) { if (ctype_punct($testcase)) { echo "The string $testcase consists of all punctuation. "; } else { echo "The string $testcase does not consist of all punctuation. "; } } ?> The above example will output: The string ABasdk!@!$# does not consist of all punctuation. The string !@ # $ does not consist of all punctuation. The string *&$() consists of all punctuation.NOTESNote If an integer between -128 and 255 inclusive is provided, it is interpreted as the ASCII value of a single character (negative val- ues have 256 added in order to allow characters in the Extended ASCII range). Any other integer is interpreted as a string contain- ing the decimal digits of the integer.SEE ALSOctype_cntrl(3), ctype_graph(3). PHP Documentation Group CTYPE_PUNCT(3)