Dear Php Proggramers,
I need simple Unicode converter.
I try this one:
PHP Code:
$Text = "50";
$beforeNu = array("0","1","2","3","4","5","6","7","8","9");
$afterNu = array("0030","0031","0032","0033","0034","0035","0036","0037","0038","0039");
$Msg = str_replace($beforeNu, $afterNu, $Text);
echo $Msg;
But The output for this code comes:
00350000330
It should come:
00350030
So, I think there is some reconverting in the code,
The Soloution Should be to convert each char. in once only (like foreach).
The other soloution I found it like:
PHP Code:
$fruit = array('a' => 'apple', 'b' => 'banana', 'c' => 'cranberry');
reset($fruit);
while (list($key, $val) = each($fruit)) {
echo "$key => $val\n";
}
But This Code is coming with [WHILE] witch is not giving me all converted in one Variable.
Please give help to find a soluotion.
Best Regards,
A. Mansouri