![]() |
[SOLVED] Arabic encoding with preg_match_all
HELLO ,
i try discovery of banned words when users posted new post , but i have a problem only Only the discovery of English words, I think that the problem is in the Arabic language encoding , I tried to solve the problem by PHP Code:
Code:
$wordss = "هالو|مرحبا|google.com"; output : google.com but Must be : google.com,مرحبا |
Maybe try putting a u at the end of your pattern string:
Code:
"/\b(" . implode($bwords,"|") . ")\b/iu" |
Quote:
i change /i to /iu and try it on Different places - on online external php file by [/iu] only - > works good - on localhost vbulletin plugin by [/i] only - > works good but .. - on localhost external php file - > don't work - on online vbulletin plugin - > don't work so .. i Become confused :erm: , i don't know what's the wrong --------------- Added [DATE]1416112678[/DATE] at [TIME]1416112678[/TIME] --------------- UPDATE : when i convert php files to encoding ANSI , Results appear in Arabic by pattern "/\b(" . implode($bwords,"|") . ")\b/i" but on plugin how i solve this problem ? |
I can't get it to work on my test system either, so I'm afraid I'm stumped. I googled to try to find an answer, but the only thing i found was something that mentioned that it's possible that some versions of php don't handle UTF-8 matching correctly.
|
Quote:
But I do not think this is the reason [php versions] , because the code work well in an external file on the same site withot encoding it but on vb plugin don't work . anyway , can i do what i want by another way ? matching banned words and print it with no problem with the Arabic words . --------------- Added [DATE]1416157331[/DATE] at [TIME]1416157331[/TIME] --------------- UPDATE : I FOUND THE Solution : \b detects word boundaries, remove them to get a regular match. JUST USE pattern Code:
"/(" . implode($bwords,"|") . ")/i " |
All times are GMT. The time now is 12:21 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|