$csvcont='';
$menu_file = file("./promotion.dat");
$menu_file2 =file("./promotion2.dat");
$zap = false;
foreach($menu_file2 as $lines2)
{
foreach($menu_file as $lines)
{
$elem = explode("<|>",$lines);
$elem2 = explode("<|>",$lines2);
if ( $elem[0] == $elem2[0])
{
$csvcont = $csvcont.$elem[0]."<|>".$elem2[1]."<|>".$elem[2]."<|>".$elem[3]."<|>\r\n";
$zap = true;
}else $csvcont = $csvcont.$lines;
}
}
if ( !$zap ) $csvcont = $csvcont.$elem[0]."<|>".$elem2[1]."<|>".$elem[2]."<|>".$elem[3]."<|>\r\n";
if(!file_put_contents( "./promotion/" . $yfile . "2.dat", $csvcont, LOCK_EX ));
2 / 60
3 / 92
4 / 100
так выходит а нужно
32 / 32
60/ 60
92/ 92
100 / 100