Problem: I want to display the date in this format "Tuesday, 28 July, 2015".
This can be achieved by below way:
$today = Carbon::today();
$days[$today->dayOfWeek] . ', ' . $today->toFormattedDateString();
But I need to duplicate the days array from carbon code. Is it possible to directly get the day of week name?
Your code snippet doesn't give you your desired format. Following the formats from http://php.net/manual/en/function.date.php you can just use echo Carbon::now()->format('l, d F, Y');.
Thank you! I get desired date format now.
Most helpful comment
Your code snippet doesn't give you your desired format. Following the formats from http://php.net/manual/en/function.date.php you can just use
echo Carbon::now()->format('l, d F, Y');.