<?php
'produto.1' => 2,
'produto.2' => 5,
'produto.3' => 3,
'produto.4' => 9
);
'produto.1' => 1,
'produto.3' => 2,
);
foreach ($result as $key => $value )
{
{
$array[ $key ] = ($value[0] - $value[1]);
}
else
{
$array[ $key ] = $value;
}
}
PD9waHAKCSRlc3RvcXVlID0gQXJyYXkgKAoJICAgICdwcm9kdXRvLjEnID0+IDIsCgkgICAgJ3Byb2R1dG8uMicgPT4gNSwKCSAgICAncHJvZHV0by4zJyA9PiAzLAoJCSdwcm9kdXRvLjQnID0+IDkKCSk7CgkkdmVuZGFzID0gQXJyYXkgKAoJICAgICdwcm9kdXRvLjEnID0+IDEsCgkgICAgJ3Byb2R1dG8uMycgPT4gMiwKCSk7CgokcmVzdWx0ID0gYXJyYXlfbWVyZ2VfcmVjdXJzaXZlKCRlc3RvcXVlLCAkdmVuZGFzKTsKCgpmb3JlYWNoICgkcmVzdWx0IGFzICRrZXkgPT4gJHZhbHVlICkKewoJaWYoIGlzX2FycmF5KCAkdmFsdWUgKSApCgl7CgkJJGFycmF5WyAka2V5IF0gPSAoJHZhbHVlWzBdIC0gJHZhbHVlWzFdKTsKCX0KCWVsc2UKCXsKCQkkYXJyYXlbICRrZXkgXSA9ICR2YWx1ZTsKCX0KfQoKIHByaW50X3IoICRhcnJheSApOyAK