Hello,
I have a logic issue that I would like to ask your help for.PHP Code:if ($codigo == 1000)
{
$dadosCriados = $resposta->response->resData->children("urn:ietf:params:xml:ns:contact-1.0")->creData;
$mensagem['id'] = $dadosCriados->id;
$mensagem['dataCriacao'] = $dadosCriados->crDate;
return $mensagem;
}
else
{
echo "Erro - O contacto nao foi criado - A resposta foi: ".$codigo." - ".$result->msg;
}
$this->logout();
On this code, I would like to return $mensagem but, as well, at the end, do the logout.
Right now, if I return $mensagem, the block execution ends, and nothing else is executed (I believe that this is the expected behavior). I cannot put the logout near the return $mensagem and before it because, it needs to be done, even if an error is returned.
Also, I cannot put return $mensagem; near the $this->logout(); line, because, if I do this, the $mensagem will be returned, even if an error occours, that we don't want that...
It must be something really dummy.
Thanks in advance,
Márcio



,








Bookmarks