How to determine the year, month and day of the string? (question update)

$rangeY = range(1950, 2015);
    $rangeM = range(1, 12);
    $rangeD = range(1, 31);
    
<select class="profile_birthday_select" name="yy" id="yy">
                <?foreach ($rangeY as $key) {?>
                  <option value="male"><?=$key;?></option>
                <?}?>
              </select>
              <select class="profile_birthday_select" name="mm" id="mm">
                <?foreach ($rangeM as $key) {?>
                  <option value="male"><?=$key;?></option>
                <?}?>
              </select>
              <select class="profile_birthday_select" name="dd" id="dd">
                <?foreach ($rangeD as $key) {?>
                  <option value="male"><?=$key;?></option>
                <?}?>
              </select>

I want to decide which year and day I should use
, but the number of past will be in this format: String
and YYYY-MM-DD

<?=$data->{"birthday"};?>

so how do I remove YYYY, MM and DD? separately?

Mar.14,2021

$date = explode('-','YYYY-MM-DD');
var_dump($date);
< hr >

range

Menu