Need to convert Γ© to e in PHP

Possible duplicate:
PHP remove accents

The name says it, but anyway ...

I get data from the input file, and inside the data we will have the symbol Γ©. For our purposes, we want to convert this to regular lowercase e.

Does anyone know how to do this?

0
source share
4 answers

Only one character? It seems too obvious ... just replace it.

$str = "Γ©";

$str = str_replace("Γ©","e",$str);

echo $str;  // "e"
+1
source

I would use this:

PHP Function: string strtr (string $ str, string $ from, string $ to)

from the PHP site:

<?php
//In this form, strtr() does byte-by-byte translation
//Therefore, we are assuming a single-byte encoding here:
$addr = strtr($addr, "Γ€Γ₯ΓΆ", "aao");
?>
+2
source

http://php.net/manual/en/function.str-replace.php

$myText = str_replace( array('Γ©'), array('e'), $myText);
0

$string = str_replace ('Γ©', 'e', ​​$ string);

0

Source: https://habr.com/ru/post/1773660/


All Articles