PHP | ctype_print() Function Last Updated : 06 Feb, 2023 Comments Improve Suggest changes Like Article Like Report The ctype_print() Function in PHP used to check each and every character of a string are visible or not. If all characters of string are visible then returns TRUE , else if there are any control character then return FALSE. Control Character: A character that does not represent a printable character but serves to initiate a particular action. for example '\n' is a control character which is not printable but perform action "Next Line" Syntax: ctype_print(string text) Parameter Used: $text : The tested string. Its a mandatory parameter. Return Values: This function return TRUE if all characters of string are printable(not containing any control character). And return FALSE if string contains any control character. Examples: Input : Geeks for geeks article Output : Geeks for geeks article -->Yes visible Explanation : The string contains three blank space and the function returns TRUE. Input : \tgfg\n Output : gfg --> No visible Explanation : '\t' and '\n' are control character . Then the function returns False. Program: 1 PHP <?php // PHP program to illustrate // ctype_print() function $string = 'GFG A Computer Science Portal'; // Checking above given strings // by used of ctype_print() function . if (ctype_print($string)) { // if true then return Yes echo "$string: Yes visible\n"; } else { // if False then return No echo "$string: No visible\n"; } ?> Output:GFG A Computer Science Portal: Yes visible Program: 2 Drive a code of ctype_print() function where input will be integer, symbols in array of strings. PHP <?php // PHP program to illustrate // ctype_print() function $strings = array( "GeeksforGeeks", "GFG2018", "\nComputerScience", "G 4 G", "@#$$.&*()_+;?~", "78 96 . 90" ); // Checking above array of strings // by used of ctype_print() function. foreach ($strings as $str) { if (ctype_print($str)) { // if true then return Yes echo "$str: (Yes visible)\n"; } else { // if False then return No echo "$str: (No visible)\n"; } } ?> Output:GeeksforGeeks: (Yes visible) GFG2018: (Yes visible) ComputerScience: (No visible) G 4 G: (Yes visible) @#$$.&*()_+;?~: (Yes visible) 78 96 . 90: (Yes visible) References : http://php.net/manual/en/function.ctype-print.php Comment More infoAdvertise with us Next Article PHP | ctype_print() Function jit_t Follow Improve Article Tags : Web Technologies PHP PHP-string PHP-function Similar Reads PHP | ctype_punct() Function The ctype_punct() is an inbuilt function in PHP which is used to check printable character which is not whitespace or an alphanumeric character. Every character in a string is printable, but neither alphanumeric, digit or blank then return True otherwise return False. Syntax: bool ctype_punct ( $tex 2 min read PHP | ctype_punct() Function The ctype_punct() function in PHP is used to check if all of the characters of a given string are punctuation characters or not. If all characters are punctuation characters then this function return TRUE, otherwise, returns FALSE. Note: The punctuation characters are, period, comma, question mark, 2 min read PHP | ctype_upper() Function The ctype_upper() function in PHP used to check each and every character of a given string is in uppercase or not. If the string in upper case then it returns TRUE otherwise returns False. Syntax: ctype_upper (string text) Parameter Used:- $text : The tested string. Return Value: Function returns Tr 2 min read PHP | ctype_xdigit() Function The ctype_xdigit() function in PHP used to check each and every character of string/text are hexadecimal digit or not. It return TRUE if all characters are hexadecimal otherwise return FALSE . Syntax : ctype_xdigit(string text) Parameters Used: text : It is mandatory parameter which specifies the te 2 min read PHP | ctype_space() Function A ctype_space() function in PHP is used to check whether each and every character of a string is whitespace character or not. It returns True if the all characters are white space, else returns False. Syntax : ctype_space(string text) Parameter Used: text :- It is a mandatory parameter which specifi 2 min read Like