Jump to content


Photo

Dictionary


  • Please log in to reply
No replies to this topic

#1 Darkness Soul

Darkness Soul
  • Members
  • PipPipPip
  • Advanced Member
  • 133 posts
  • LocationBrazil; São Paulo.

Posted 06 April 2006 - 08:33 PM

Hi guys,

I was mak'ng a dictionary function for portuguese language, that's replace wrong words for they correct word, like "agua" for "água".

My function:
function fun_dictionary ( $fun_string )
{
    $str_wrong  = array( "DIRECAO" , "HIDRAULICA" , "TERMICO" );
    $str_right = array( "direção" , "hidráulica" , "térmico" );
    $fun_string = ucwords ( strtolower ( preg_replace ( $str_wrong, $str_right, $fun_string )));
    return $fun_string;
}
But, when I call it, like that:
print $str_text = fun_dictionary ( 'DIRECAO HIDRAULICA, SENSOR TERMICO' );
It's print like this:
Direcao Hidraulica, Sensor Termico
What I suppose to do? Where is my fault?

Thanks, anyway.. D.Soul

(If something is wrong, please tell me. I'm learning this language. Thank you)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users