If you want to convert string as a array then first define a array variable, for example:
$data=array();
Then use a loop FOR/FOREACH/WHILE
I am done here using foreach loop, follow the example code.
Example code:
<?php
$my_days=array();
foreach ($special_days as $spday) {
$my_days[]=date(‘d-m-Y’,strtotime($spday));
}
print_r($my_days);
Here $my_days is the user define variable you can change the variable name.
Question and answer is powered by AnsPress.io