My code for reference:
$data1 = date('d-m-Y');
$array = array();
$i = 0;
while($i < 20){
$datagenerica = substr($data1,stripos($data1,'-'));
$datagenerica = $i.$datagenerica;
$data = date('w',strtotime($datagenerica));
$array[] = $data;
$i++;
}
$array = array_unique($array);
sort($array);
I need the numbers stored within this array to be converted to weekday names, for example: 1 = Sunday
. I would also like to know if this can be done natively in PHP, or will it be necessary to use a library?