Assuming i have
$a='1024,1025,0000|1020,0000|';
$b='1024,1025,0000,1020,0000,';
i want replace commas (,) in $b with (|) so that $b is equal to $a like this
$b='1024,1025,0000|1020,0000|';
if i use
$ob=str_replace("0000,","0000|",$b);
echo $ob;
output works :
1024,1025,0000|1020,0000|
But, how to make it with PHP where did i put that this refers to the $a and what if it does not always 0000, with other purposes may be i want replace character referring to another character sequence in the array, so that $b is equal to $a, other sample :
eg :
$a='1024,1025,1234|1020,0000|';
$b='1024,1025,1234,1020,0000,';
output:
$b='1024,1025,1234|1020,0000|';
thanks to your help.
regards,