Hello all, i am making a php scrip that needs to convert special caracters
html code and i've done a function to do that
the prob is that this only work to the é or ê caracteres and not the all the
other special caracaters like á ç for instance...
can some1 see the code below and try do help me with this?
here's what i have done:



$word = $HTTP_GET_VARS["word"];
regexp($word);

function regexp ($palavra)
{
$car[0] = 'ç';
$car[1] = 'á';
$car[2] = 'à';
$car[3] = 'ã';
$car[4] = 'â';
$car[5] = 'ó';
$car[6] = 'õ';
$car[7] = 'ô';
$car[8] = 'í';
$car[9] = 'ú';
$car[10] = 'é';
$car[11] = 'ê';

$code[0] = 'ç';
$code[1] = 'á';
$code[2] = 'à';
$code[3] = 'ã';
$code[4] = 'â';
$code[5] = 'ó';
$code[6] = 'õ';
$code[7] = 'ô';
$code[8] = 'í';
$code[9] = 'ú';
$code[10] = 'é';
$code[11] = 'ê';


$palavra = strtolower ($palavra);


for ( $i = 0 ; $i <= 11 ; $i++ )
  {
   $coded = eregi_replace ( $car[$i] , $code[$i] , $palavra );
  }
echo "Coded:";
echo $coded ;
echo "<br>";
echo "Palavra:";
echo $palavra;
echo "<br>";

}
?>

Procura:
<FORM ACTION="" METHOD="get">
<INPUT TYPE= "text" NAME = "word"><br>
<INPUT TYPE=submit Value = "Procurar">
</form>



*******************************************
Pedro Miguel Silva Oliveira
Cell Phone: +351 96 5867227
SMS: [EMAIL PROTECTED]
Email: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to