3
I’m passing a date inside an index of a Array
. As the looping is being performed, this Array
is being fed. The index is also generated through this looping.
However, when printing the index, it displays only 1 character (as if it were "fragmented" within the Array
). I think it’s a simple mistake, but I’m beating myself up for not going through it yet.
$pcb_data = array();
while($r = $DB->fetchArray($result)){
$pcb_cmb_id = $r['pcb_cmb_id'];
$pcb_data[$pcb_cmb_id] = date("d/m/Y", strtotime($r['pcb_data']));
}
If I print $pcb_data[4]
, for example, it will display "2" instead of a date (ex: 12/12/1988).
Note: I cut the while pq code the rest of the information is not relevant, in this case.
Can someone help me, please?
Of a
print_($pcb_data)
; after the while, put in the comments after– rray
It was found that the variable of the array was being overwritten by other information, probably created for previous tests... Thank you for the aid.
– Thiago Alessandro