Syntax
ctype_graph ( $text ); |
Definition and Usage
This function checks if all of the characters in the provided string, text, creates visible output.
Paramters
Parameter | Description |
---|---|
text | Required. The tested string. |
Return Value
Returns TRUE if every character in text is printable and actually creates visible output (no white space), FALSE otherwise.
Example
Try out following example:
<?php $strings = array('asdf\n\r\t', 'arf12', 'LKA#@%.54'); foreach ($strings as $testcase) { if (ctype_graph($testcase)) { echo "$testcase consists of all (visibly) printable characters<br />"; } else { echo "$testcase does not have all (visibly) printable characters.<br />"; } } ?> |
This will produce following result:
asdf\n\r\t does not have all (visibly) printable characters. arf12 consists of all (visibly) printable characters LKA#@%.54 consists of all (visibly) printable characters |
No comments:
Post a Comment