Start Free Trial
Come for the solution, stay for everything else.
Start Free Trial
str_replace unicode Error
I try to convert string to unicode but I can't save the script because the server doesn't run the code. The server display the whole script.
Please copy the text below into notepad or any text editor and save as something.php and please remember to pick the encoding option to be Unicode.
$a = "a` a('";
$a = str_replace(array("a`", "a('"), array("à ", "ắ "), $a);
8/22/2022 - Mon
If you see the source of the file, then your webserver is not configured to execute php-scripts correctly. As long as the "<?php" is not encoded in unicode and your webserver is configured correctly you will not see the code of your script.
let me try to build the include file and include that file in to see if php server can understand it.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
ASKER CERTIFIED SOLUTION
Log in or sign up to see answer
Become an EE member today
7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
the à is unicode
à á ấ ơ ờ ư đ
experts-exchange.com change my unicode to some strange numbers
the ấ is actually the letter a( but the ( is on the top of the a.
That give me a hint, I should convert my unicode to ascii then use it.
a á à ạ ả ã
ă ắ ằ ặ ẳ ẵ
â ấ ầ ậ ẩ ẫ
e é è ẹ ẻ ẽ
ê ế ề ệ ể ễ
u ú ù ụ ủ ũ
ư ứ ừ ự ử ữ
i í ì ị ỉ ĩ
o ó ò ọ ỏ õ
ơ ớ ờ ợ ở ỡ
ô ố ồ ộ ổ ỗ
to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Hey! Glad to have helped. (Did I?).
What happens if you encode both pages as UTF-8? That SHOULD work better.
Plans and Pricing
Certified Expert Program
© 1996-2022 Experts Exchange, LLC. All rights reserved. Covered by US Patent