Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ramlashkar's avatar

How to split Date Range input to store?

// 14/03/2020 - 12/04/2020 //

$z = $request->input('dateRange');

dd($x);

0 likes
2 replies
Tray2's avatar
Tray2
Best Answer
Level 73

This is the easiest way.

$dates = explode(' - ' ,$x);

It will give you

=> [
     "14/03/2020",
     "12/04/2020",
   ]

Please or to participate in this conversation.