Welcome Guest, Not a member yet? Register   Sign In
looking for the Ñ
#1

[eluser]alebenson[/eluser]
hi!

im trying to find a latin character to strip but nothing WORKS!!!!
ive try everything i found..

the character is 'ñ'

i try:
Code:
$enie = htmlentities('ñ');
echo html_entity_decode($enie);

result: '?'
Code:
echo ord("ñ");
result: 241

echo chr(241);
result: '?'

Code:
print_r (get_html_translation_table(HTML_ENTITIES));

result:

Array ( [�] =>   [�] => ¡ [�] => ¢ [�] => £ [�] => ¤ [�] => ¥ [�] => ¦ [�] => § [�] => ¨ [�] => © [�] => ª [�] => « [�] => ¬ [�] => ­ [�] => ® [�] => ¯ [�] => ° [�] => ± [�] => ² [�] => ³ [�] => ´ [�] => µ [�] => ¶ [�] => · [�] => ¸ [�] => ¹ [�] => º [�] => » [�] => ¼ [�] => ½ [�] => ¾ [�] => ¿ [�] => À [�] => Á [�] => Â [�] => Ã [�] => Ä [�] => Å [�] => Æ [�] => Ç [�] => È [�] => É [�] => Ê [�] => Ë [�] => Ì [�] => Í [�] => Î [�] => Ï [�] => Ð [�] => Ñ [�] => Ò [�] => Ó [�] => Ô [�] => Õ [�] => Ö [�] => × [�] => Ø [�] => Ù [�] => Ú [�] => Û [�] => Ü [�] => Ý [�] => Þ [�] => ß [�] => à [�] => á [�] => â [�] => ã [�] => ä [�] => å [�] => æ [�] => ç [�] => è [�] => é [�] => ê [�] => ë [�] => ì [�] => í [�] => î [�] => ï [�] => ð [�] => ñ [�] => ò [�] => ó [�] => ô [�] => õ [�] => ö [�] => ÷ [�] => ø [�] => ù [�] => ú [�] => û [�] => ü [�] => ý [�] => þ [�] => ÿ ["] => " [<] => <  [>] => >  [&] => & )

how can i strip the 'ñ'?
#2

[eluser]xwero[/eluser]
What encoding are you using for the page?
#3

[eluser]alebenson[/eluser]
content="text/html; charset=utf-8"
#4

[eluser]Pygon[/eluser]
str_replace(chr(241),'n',$mystring) doesn't work?
#5

[eluser]xwero[/eluser]
try using charset=iso-8859-1.
#6

[eluser]alebenson[/eluser]
it works
i try
str_replace('ñ','','año')
and
str_replace('&+ntilde;','','año')

the first one didnt do anything. the second works
Now, i just need to look for every 'ñ' in the DB and change it by '&+ntilde;'

thanks again xwero!!
#7

[eluser]xwero[/eluser]
It's possible another charset supports the other n character.
#8

[eluser]Pygon[/eluser]
I put him in the right direction and xwero gets the credit. Pfft... Tongue
#9

[eluser]alebenson[/eluser]
Confusedhut: Dought!
i didnt see your post... i guess i was answering and in the middle.. the whole thing.. baaah ok
i didnt try that one it may have worked
for now i have a horrible code there playing with the ñ
thanks pygon :roll:
#10

[eluser]xwero[/eluser]
There goes my credit Smile I made myself believe alebenson made my change but used Pygons solution by mistake Tongue




Theme © iAndrew 2016 - Forum software by © MyBB