Let's say a user submits a comment and I want to obtain the array of Unicode code points of its value, select what code points are invalid and discard them, and save the comment. How can I do that?
e.g.
The user submits "hello", and I want to obtain an array $codepoints
with the following values:
$codepoints[0] = 0068
$codepoints[1] = 0065
$codepoints[2] = 006C
$codepoints[3] = 006C
$codepoints[4] = 006F
And, for some strange reason, I don't want to allow the letter "l", so I want to discard the characters with the code point U+006C. So the saved comment would be "heo". Is this even possible?
Thanks in advance!