<?php $strings = [ 'Vanilla', 'Curaçao', 'Vanilla Ice', "Vanilla\nIce", 'वैनिला', 'فانيليا', 'དྲི་ཞིམ་ལྡན་པའི་རྩྭ།', '12345!?', "\t", " ", ]; function is_utf8_printable($string): bool { return (bool) preg_match('~^[[:print:]]+$~u', $string); } $printable = array_map(function($string) { // $is = ctype_print($string); $is = is_utf8_printable($string); return [$string => $is]; }, $strings); var_dump($printable);
You have javascript disabled. You will not be able to edit any code.