$arr = array('13.5\n', 'abcXYZ', 'AbCd1fgH7', 'xyz@!$wsp', '*$!()[]');
foreach ($arr as $s)
{
if (ctype_punct($s))
echo "$s is all punctuation <br />";
else
echo "$s is NOT all punctuation <br />";
}
/*
run:
13.5\n is NOT all punctuation
abcXYZ is NOT all punctuation
AbCd1fgH7 is NOT all punctuation
xyz@!$wsp is NOT all punctuation
*$!()[] is all punctuation
*/