0
I tried to follow some examples of masks but I could not integrate in my code... someone could help me?
<table style="width: 100%" border="0">
<thead>
<tr style="text-align: left;">
<th>Data</th> // Data ta retornando assim: 2019-03-28T00:00:00
<th>Valores</th> // Valores esta retornando assim: 4688.86
<th>CPF</th> // Mascara para CPF
<th>CNPJ</th> // Mascara para CNPJ
</tr>
</thead>
<tbody>
<?php
foreach ($json_data["Result"] as $data) {
foreach ($data["CreditData"][0]["Occurrences"][0]["Details"] as $details) {
echo '<tr>';
echo '<td>' .$details["ExpiringDate"].'</td>'; // preciso da data 01/01/2019
echo '<td> R$: ' .$details["Value"].'</td>'; // preciso do valor R$ 111.111.111,00
echo '<td> R$: ' .$details["cpf"].'</td>'; // Retornando CPF
echo '<td> R$: ' .$details["cnpj"].'</td>'; // Retornando CNPJ
echo '</tr>';
}
}
?>
</tbody>
</table>
In case of value my return line is:
// echo '<br>Valor Total em Ocorrencias: R$ ' .$data["CreditData"][0]["TotalDebts"];
echo number_format($data["CreditData"][0]["TotalDebts"], 2, ",", ".");
But it didn’t work, the disabled line works my return R $ 111111111.00
Gabriel Roberto.. was worth the tip.... Date and Time I managed to put the Mascara.... but for the value not achieve... I edited my question for the friend view how is my value return line...
– Marcos RS
@Marcosrs, checks what type of value is being returned, you may need to convert the value to float, if it is a string, for this you can use the floatval function()
– Gabriel Roberto
Gabriel, I got it... it worked. Tell me something and to put mask in zip code and phone? has an example...different from the example of the site the friend indicated, or can I follow the same logic as the CPF? $cep = Mask($Details["cep"], '#####.###');
– Marcos RS
Can follow the same logic of Cpf even, it is good that you already have the function ready.
– Gabriel Roberto