Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ctype_print(3) [php man page]

CTYPE_PRINT(3)								 1							    CTYPE_PRINT(3)

ctype_print - Check for printable character(s)

SYNOPSIS
bool ctype_print (string $text) DESCRIPTION
Checks if all of the characters in the provided string, $text, are printable. PARAMETERS
o $text - The tested string. RETURN VALUES
Returns TRUE if every character in $text will actually create output (including blanks). Returns FALSE if $text contains control charac- ters or characters that do not have any output or control function at all. EXAMPLES
Example #1 A ctype_print(3) example <?php $strings = array('string1' => "asdf ", 'string2' => 'arf12', 'string3' => 'LKA#@%.54'); foreach ($strings as $name => $testcase) { if (ctype_print($testcase)) { echo "The string '$name' consists of all printable characters. "; } else { echo "The string '$name' does not consist of all printable characters. "; } } ?> The above example will output: The string 'string1' does not consist of all printable characters. The string 'string2' consists of all printable characters. The string 'string3' consists of all printable characters. NOTES
Note 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 ALSO
ctype_cntrl(3), ctype_graph(3), ctype_punct(3). PHP Documentation Group CTYPE_PRINT(3)

Check Out this Related Man Page

CTYPE_GRAPH(3)								 1							    CTYPE_GRAPH(3)

ctype_graph - Check for any printable character(s) except space

SYNOPSIS
bool ctype_graph (string $text) DESCRIPTION
Checks if all of the characters in the provided string, $text, creates visible output. PARAMETERS
o $text - The tested string. RETURN VALUES
Returns TRUE if every character in $text is printable and actually creates visible output (no white space), FALSE otherwise. EXAMPLES
Example #1 A ctype_graph(3) example <?php $strings = array('string1' => "asdf ", 'string2' => 'arf12', 'string3' => 'LKA#@%.54'); foreach ($strings as $name => $testcase) { if (ctype_graph($testcase)) { echo "The string '$name' consists of all (visibly) printable characters. "; } else { echo "The string '$name' does not consist of all (visibly) printable characters. "; } } ?> The above example will output: The string 'string1' does not consist of all (visibly) printable characters. The string 'string2' consists of all (visibly) printable characters. The string 'string3' consists of all (visibly) printable characters. NOTES
Note 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 ALSO
ctype_alnum(3), ctype_print(3), ctype_punct(3). PHP Documentation Group CTYPE_GRAPH(3)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

simple sed question

hi is it possible to cut this two semicolon separated sed commands echo "string2 string3 string1" | sed s'/string1//g;s/string2//g' output: " string3 " to just one sed command without semicolon? thanks in advance funksen (10 Replies)
Discussion started by: funksen
10 Replies

2. Shell Programming and Scripting

How to append words at the end of first line

Hi Unix gurus This is my first post here. I have a file which looks like this: string1,string2 ,string3 ,string4 ... ... I need to append all words below first line to the first line, ie string1,string2,string3,string4,... Bear in mind that it is not known how many lines follow... (11 Replies)
Discussion started by: lmatlebyane
11 Replies

3. Shell Programming and Scripting

Grep Multiple Strings

Hi, Can any one pelase tell me how to grep multiple strings from multiple files in a singel folder? grep -E "string1|string2|string3|string4|string..." its taking lots of time.. can any please tell me fast grep??? URGENT (10 Replies)
Discussion started by: durgaprasad
10 Replies

4. Shell Programming and Scripting

ps -ef | grep "string1" "string2" " "string3"

Hi all, can any one suggest me the script to grep multiple strings from ps -ef pls correct the below script . its not working/ i want to print OK if all the below process are running in my solaris system. else i want to print NOT OK. bash-3.00$ ps -ef | grep blu lscpusr 48 42 ... (11 Replies)
Discussion started by: steve2216
11 Replies

5. Shell Programming and Scripting

Pad space at the end of string and reformat

I need to read in the string from input file and reform it by cut each segment and check the last segement lenght. If the last segment length is not as expected (see below segment file or table. It is predefined), then pad enough space. Old string FU22222222CA6666666666AKxvbFMddreeadBP999... (11 Replies)
Discussion started by: menglm
11 Replies

6. Shell Programming and Scripting

How to convert special characters?

Hi All, I have some text including Turkish characters and the 3rd party application that reads my file does not supporting this character set (at least, I have no control on it). So, I used below conversion for maximum character support but still have problems with "İ" and "Ş". Application... (5 Replies)
Discussion started by: mrcrowley
5 Replies

7. Shell Programming and Scripting

Import ASCII 28 delimited text file

I have an ASCII 28 delimited text file(non-printable delimiter) with 4 columns along with the header.I need to open this text file in Excel or any other tool to view each column content. Please help.. Thanks (6 Replies)
Discussion started by: aneeta13
6 Replies

8. HP-UX

Replacing control characters in HPUX

Hello dears, Please tell me how can I replace control characters with normal string. I have a file that contains normal string and ^A ^C control characters. I tried to use sed and awk without any luck. sed 's/^A/foo/g' text > text1 //not worked sed 's/\x01/foo/g' text > text1 ... (6 Replies)
Discussion started by: sembii
6 Replies

9. Shell Programming and Scripting

Supress text

Hi, I was looking for a simple code to suppress the text between 2 characters. the characters can be of same kind like "*" or "(" and ")". The number of characters are not consistent and could vary. How can I suppress the text between 2 characters? Example: Input : Hello (Within Bracket)... (8 Replies)
Discussion started by: ahmedwaseem2000
8 Replies

10. Shell Programming and Scripting

ksh check for non printable characters in a string

Hi All, I am trying to find non-printable characters in a string. The sting could have alphanumeric, puntuations and characters like (*&%$#.') but not non-printable (or that is what I think they are called) which are introduced when you copy any text from DOS to unix box. Input string1:... (10 Replies)
Discussion started by: dips_ag
10 Replies

11. Shell Programming and Scripting

Search a text and return the text from file

Hi I have a set of input strings in a pattern as given below string1 string2 string3 string4 string5 I need to search this sequence of strings from a file in such a way that the first two strings (string1 and string2) and last two strings (string4 and string5) should match with the... (8 Replies)
Discussion started by: my_Perl
8 Replies

12. Shell Programming and Scripting

Redirecting records with non-printable characters

Hi, I have a huge file (50 Mil rows) which has certain non-printable ASCII characters in it. I am cleaning the file by deleting those characters using the following command - tr -cd '\11\12\15\40-\176' < unclean_file > clean_file Please note that I am excluding the following - tab,... (6 Replies)
Discussion started by: rishigc
6 Replies

13. Shell Programming and Scripting

Bash - Inserting non printable character(s) in string variable

Hello. I have a string variable named L_TEMP to test a very simple filter. L_TEMP="50AwL.|KWp9jk" I want to insert a non printable character between K and W. I have try this : linux-g65k:~ # a='50AwL.|K' linux-g65k:~ # b='Wp9jk' linux-g65k:~ # L_TEMP="$a$'\x07'$b" linux-g65k:~ # echo... (6 Replies)
Discussion started by: jcdole
6 Replies

14. Shell Programming and Scripting

Replace string2 by string3 where string1 is found in line

Hello, My aim is to search string1 in all lines. When found, find and replace string2 by string3 if possible. TextFile: Here is my first line Second line with string1 & string2 Not last line but it contains string1 Expected output: Here is my first line The second line with string1 &... (6 Replies)
Discussion started by: baris35
6 Replies

15. OS X (Apple)

Undeletable file

Greetings, I'm trying to delete a file with a weird name from within Terminal on a Mac. It's a very old file (1992) with null characters in the name: “␀␀Word FinderÂŽ Plus™”. Here are some examples of what I've tried: 12FX009:5 dpontius$ ls ␀␀Word FinderÂŽ Plus™ 12FX009:5 dpontius$ rm... (29 Replies)
Discussion started by: dpontius
29 Replies