public function listaProdutos() { try { $ProdutosSistema = new Carrinho(); $lista = $ProdutosSistema->recuperarProdutosSistema(); $new = array(); foreach ($lista as $value) { if ($value['id'] != 1) { $new[] = array('id' => $value['id'], 'nome' => utf8_encode($value['nome']), 'valor' => $value['valor']); } } echo json_encode($new); } catch (Exception $ex) { echo $ex->getMessage(); } }