I want filter input just for Farsi, i think regular expression with filter_input()
is a good idea but
i dont know how solve this problem, I've search but i don't find sth like \p{Arabic} for Farsi or Persian character in the other hand it can be possible with Unicode but i've no idea about its regular expression.
This should work :
preg_match("(^[\x{0600}-\x{06FF}]*$)", 'فارسی');
And also you can use all these forms for Persian language :
Persian Alphabet
فارسی
/^([\x{0600}-\x{06EF}])+$/
Persian Numbers
۱۲۳۴۵۶۷۸۹۰
/^([\x{06F0}-\x{06F9}])+$/
Persian simple text with space and half-space
اگر زمان و مکان در اختیار ما بود، ۱۰ سال پیش از طوفان نوح عاشقت میشدم
/^([\x{0600}-\x{06FF}| |\x{200C}])+$/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With