PHP

Are preg_match and preg_replace Multi-Byte Safe?

Posted on
The direct answer is yes. Both preg_match and preg_replace functions can be multi-byte safe. But at least, you have to meet the following two requirements to make them work well.Use u as one of your modifiers to the pattern.For example, I would like to match a word “中” in a string, I should do this:$str = “数据库中介”;$flag […]
Eclipse

How to Change File Encoding in Eclipse

Posted on
There’re two ways to change files encoding, you can change them locally or globally.A. Change file encoding locally.Please right-click on any folder or file in Project Explorer. Then click “Properties” on the menu.Change “Text file encoding” as you like.B. Change file encoding globally.This option will apply all files in the workspace. First, click Window > […]