Convert vietnamese to english php

This PHP file must be saved in UTF-8 encoding.

function stripVN($str) {
    $str = preg_replace("/(à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ)/", 'a', $str);
    $str = preg_replace("/(è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ)/", 'e', $str);
    $str = preg_replace("/(ì|í|ị|ỉ|ĩ)/", 'i', $str);
    $str = preg_replace("/(ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ)/", 'o', $str);
    $str = preg_replace("/(ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ)/", 'u', $str);
    $str = preg_replace("/(ỳ|ý|ỵ|ỷ|ỹ)/", 'y', $str);
    $str = preg_replace("/(đ)/", 'd', $str);

    $str = preg_replace("/(À|Á|Ạ|Ả|Ã|Â|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ă|Ằ|Ắ|Ặ|Ẳ|Ẵ)/", 'A', $str);
    $str = preg_replace("/(È|É|Ẹ|Ẻ|Ẽ|Ê|Ề|Ế|Ệ|Ể|Ễ)/", 'E', $str);
    $str = preg_replace("/(Ì|Í|Ị|Ỉ|Ĩ)/", 'I', $str);
    $str = preg_replace("/(Ò|Ó|Ọ|Ỏ|Õ|Ô|Ồ|Ố|Ộ|Ổ|Ỗ|Ơ|Ờ|Ớ|Ợ|Ở|Ỡ)/", 'O', $str);
    $str = preg_replace("/(Ù|Ú|Ụ|Ủ|Ũ|Ư|Ừ|Ứ|Ự|Ử|Ữ)/", 'U', $str);
    $str = preg_replace("/(Ỳ|Ý|Ỵ|Ỷ|Ỹ)/", 'Y', $str);
    $str = preg_replace("/(Đ)/", 'D', $str);
    return $str;
}

$string = "Cộng hòa xã hội chủ nghĩa Việt Nam";
$xstring = stripVN($string);

echo $xstring;
//Output: Cong hoa xa hoi chu nghia Viet Nam

Loading

1.00000 VND = 0.00247 PHP

Mid-market exchange rate at 00:35 UTC

We can't send money between these currencies

We're working on it. Sign up to get notified, and we’ll let you know as soon as we can.

1

Input your amount

Simply type in the box how much you want to convert.

2

Choose your currencies

Click on the dropdown to select VND in the first dropdown as the currency that you want to convert and PHP in the second drop down as the currency you want to convert to.

3

That’s it

Our currency converter will show you the current VND to PHP rate and how it’s changed over the past day, week or month.

Is there a function that coverts special characters to their english equivalents. For Eg. Convert é to e. Etc...

asked Mar 2, 2010 at 9:03

The function you are after is iconv() - from the user notes, this seems to be what you want to do: characters transliteration

answered Mar 2, 2010 at 9:09

danpdanp

14.2k6 gold badges40 silver badges48 bronze badges

4

You should use this one and it will works:

setlocale(LC_CTYPE, 'nl_BE.utf8');
$string = iconv('UTF-8', 'ASCII//TRANSLIT', $string);

I've tested it a lot of accentuated characters

Convert vietnamese to english php

eggyal

120k18 gold badges205 silver badges236 bronze badges

answered Apr 28, 2010 at 12:07

If you don't like danp's solution (iconv), you could use strtr with a list of conversions. This page has a sample script (first Google result).

answered Mar 2, 2010 at 9:17

MatthewMatthew

46.8k11 gold badges85 silver badges97 bronze badges

You could make a function holding a array of chars you want exchanged and pass strings through and just change ã to a that way, if iconv() doesn´t work out for you.

answered Mar 2, 2010 at 10:16

Vietnamese Dong & Philippine Peso Currency Information

FACT 1: The currency of Vietnam is the Vietnamese Dong. It’s code is VND & it's symbol is ₫. According to our data, USD to VND is the most popular Vietnam Dong exchange rate conversion.

FACT 2: The most popular banknotes used in Vietnam are: ₫100, ₫200, ₫500, ₫1000, ₫2000, ₫5000, ₫10000, ₫20000, ₫500000. It's only used in Vietnam.

FACT 3: The Vietnamese Dong was officially introduced in 1978. Since then, several commemorative coins in copper, brass, copper-nickel, silver, and gold have been issued but have never come in to circulation.

FACT 1: The currency of Philippines is the Philippine Peso. It’s code is PHP & it's symbol is ₱. According to our data, PHP to USD is the most popular Philippine Peso exchange rate conversion.

FACT 2: The most popular banknotes used in Philippines are: ₱20, ₱50, ₱100, ₱200, ₱500, ₱1000. It's used solely in the Philippines.

FACT 3: In 1949, The Central Bank of the Philippines was established which lead to the introduction of the Peso. Bankotes have undergone several redesigns with a number of issues for commemorations.

VND to PHP Money Transfers & Travel Money Products

Convert vietnamese to english php

Convert vietnamese to english php