javascript - Separating date and month from the given date
171
I've created a text-box where I'm binding date and year. This is how I've done:
jQuery("#year_month").datetimepicker({ format: 'YYYY-MM' });
This is how I receive in php:
$year_month = mysqli_real_escape_string($mysqli, $_REQUEST["year_month"]);
Here I have to separate the year and month. How can I do that?
Answer
Solution:
try use
explode()
function:output:
Answer
Solution:
You can extract the year and month from your datestring with the PHP
function.