P
P
polyakov_andrey2011-11-11 00:59:43
PHP
polyakov_andrey, 2011-11-11 00:59:43

Character filtering in php

Hello habrazhiteli, please tell me how to filter all graphic characters using php?
(maybe there is a tricky regexp or something else)
For example:

★★•♥ღ•♥ღ۞۞♪ϟ♥╬  ⎳ ◊๑♫╚► ۞

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
doubt, 2011-11-11
@doubt

If you need only Russian and English letters, and other symbols,

I
interrupt_controller, 2011-11-11
@interrupt_controller

One of the solutions: run through the string, find and isolate the characters you need by ascii codes using the ord () function.
ascii character table:
www.tcp-ip-info.de/tcp_ip_und_internet/ascii.gif

L
LastDragon, 2011-11-11
@LastDragon

Use the u modifier and the desired escape sequences from here:
en2.php.net/manual/en/regexp.reference.unicode.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question