<?php
$destaque = 2;
'idFoto' => 1,
'img' => '1.jpg',
'destaque' => null
);
'idFoto' => 2,
'img' => '2.jpg',
'destaque' => null
);
'idFoto' => 3,
'img' => '3.jpg',
'destaque' => null
);
foreach( $fotos as $n => $foto )
{
if( $foto['idFoto'] === $destaque )
$fotos[$n]['destaque'] = 1;
}
PD9waHAKJGRlc3RhcXVlID0gMjsKCiRmb3Rvc1tdID0gYXJyYXkoCgknaWRGb3RvJyA9PiAxLAoJJ2ltZycgPT4gJzEuanBnJywKCSdkZXN0YXF1ZScgPT4gbnVsbAopOwoKJGZvdG9zW10gPSBhcnJheSgKCSdpZEZvdG8nID0+IDIsCgknaW1nJyA9PiAnMi5qcGcnLAoJJ2Rlc3RhcXVlJyA9PiBudWxsCik7CgokZm90b3NbXSA9IGFycmF5KAoJJ2lkRm90bycgPT4gMywKCSdpbWcnID0+ICczLmpwZycsCgknZGVzdGFxdWUnID0+IG51bGwKKTsKCgpmb3JlYWNoKCAkZm90b3MgYXMgJG4gPT4gJGZvdG8gKQp7CglpZiggJGZvdG9bJ2lkRm90byddID09PSAkZGVzdGFxdWUgKQoJJGZvdG9zWyRuXVsnZGVzdGFxdWUnXSA9IDE7Cn0KCnByaW50X3IoICRmb3RvcyApOw==