i have an array named $data
$data = array(
'word1'=>'Šššš',
'word2'=>'Zzzzžzzž',
'word3'=>'Āāāa'
);
what i want to do is to create new array with the same keys but with different values, so my new array would look like this:
$newdata = array(
'word1'=>'Ssss',
'word2'=>'Zzzzzzzz',
'word3'=>'Aaaa'
);
all i want to do is to replace letters with diacritical mark to normal letter, i have searched for php functions and i have understood that i could use str_replace
function like this:
$search = array('Ā', 'ā', 'Š', 'š', 'Ž', 'ž');
$replace = array('A', 'a', 'S', 's', 'Ž', ž);
str_replace($search, $replace, $data);
but how can i loop
through array
checking and replacing values without touching keys
?
or i cannot do that?(all data have to be be checked)