I have string as below:
- abccdefx7f (notice that the ‘x7f’ is Del key on keyboard) I want to check if the above string has control key or not ?
Control keys include: Del, Tab, Esc, F1 ~ F12, Shift,….
Please help me the solution, I am using PHP code.
Advertisement
Answer
There,
You can use the php
s ctype
extension there are many functions to do your stuff.
For Exmaple you can use ctype_print() function which Checks all chars if there printable as cntrl chars aren’t printable it should help you.
$x = "asbahsdbx7f"; $y = "JustText"; var_dump( ctype_print($x), // False ctype_print($y) // True );