function it($soz){
$arr1=array("1","2","3","4","13","44");
$arr2=array("text1","text2","text3","text4","text5","text6");
$netice=str_ireplace($arr1,$arr2,$soz);
echo $netice;
}
it(44);
Результат должен быть text6 а выводит text2text2 как быть ??
function it($soz){
$arr1=array("1","2","3","4","13","44");
$arr2=array("text1","text2","text3","text4","text5","text6");
$netice=str_ireplace($arr1,$arr2,$soz);
echo $netice;
}
it(44);
function it($soz){
$arr = array(
"1" => "text1",
"2" => "text2",
"3" => "text3",
"4" => "text4",
"13" => "text5",
"44" => "text6"
);
$netice = strtr($soz, $arr);
echo $netice;
}
it('44');