Click here for Toll-Free Service for your business starting at $2.00 per month

Main Menu

STR_REPLACE doing weird things.

Started by sixthcrusifix, December 02, 2005, 05:52:59 AM

Previous topic - Next topic


I'm using it to translate albhead to english with this:

$letters2 = array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");
$letters1 = array("Y","P","L","T","A","V","K","R","E","Z","G","M","S","H","U","B","X","N","C","D","I","J","F","Q","O","W");
$msg2 = str_replace($letters2,$letters1,$msg);
echo ($msg2);

First of all I have to use one uppercase and one lower or nothing works.

Secondly is you type in a few words it works, but if you type in a whole paragraph some of the letters are mistranslated and show the wrong replacement letter. Why is this??
Visite me website at