I have two arrays:
$array1 = array(a=>"1", p=>"2", l=>"3", "e"=>"4");
$text = "apple";
$array2 = preg_split('//', $text, -1, PREG_SPLIT_NO_EMPTY);
I want to search and replace character by character the phrase $text with the contents of $array1
so that
"Apple" Returns "12234"
A=1
P=2
P=2
L=3
E=4