I have the following code:
$respostaXML = "<data-hora>2015-11-10T11:33:41.086-02:00</data-hora>";
$posTag = strpos($respostaXML,"<data-hora>");
$comprimento = (strpos($respostaXML,"</data-hora>") - strpos($respostaXML,"<data-hora>"));
$respDataHora = substr($respostaXML,$posTag,$comprimento);
$respData = substr($respDataHora,9,2) . "/" . substr($respDataHora,6,2) . "/" . substr($respDataHora,1,4);
$respHora = substr($respDataHora,12,8);
My intention is that in respData I get "10/11/2015" and in the "11:33:33" resp. It turns out the result is this:
respDataHora = 2015-11-10T11:33:41.086-02:00
respData = a>/ho/data
respHora = 015-11-1
The response time is OK, the response has already given this bizarre result (excerpts from the NAME of the previous variable), and the response must have given those numbers for the same reason.
The same code, with syntax differences and functions, of course, works perfectly in classic ASP. What's happening there?