如何从用户提供的PHP日期格式字符串中提取和显示单独的日/月/年?

I have a custom blog module in WordPress. The user is allowed to specify whatever PHP date format they want when configuring the module. For example, 'j m Y'.

The module outputs the day, month and year on separate lines. It currently defaults to using the 'd F Y' format. So that July 6, 2018 would display as follows:

06

JUL

2018

<?php   
        // If we have chosen to show a date, get individual date components for style 4
        if ( 'on' === $show_date ) {
            $ci_post_date  = get_the_date( );
            $ci_post_day   = date('d', strtotime( $ci_post_date ) ); // 01 - 31 day format
            $ci_post_month = date('M', strtotime( $ci_post_date ) ); // 3 character month format (Jan - Dec)
            $ci_post_year  = date('Y', strtotime( $ci_post_date ) ); // 4 digit year format
        ?>
            <div class="ci-date post-meta">
                <span class="ci-day">  <?php echo $ci_post_day ?>  </span>
                <span class="ci-month"><?php echo $ci_post_month ?></span>
                <span class="ci-year"> <?php echo $ci_post_year ?> </span>
            </div>
        <?php
        }

The spans above are formatted via CSS to show on separate line. This also allows the user to have their own custom CSS for each date portion.

There is also a variable, $meta_date, that will hold the user supplied date format string. But I don't know how to extract the supplied format for each date component so that I can echo it correctly.

I am not able to figure out how to format each of those three lines based on that user supplied format string. Any examples I have seen on all the PHP documentation and here in Stack all assume that the date format is known. Hard-coded, if you will.

I'd like to display the day of the month on one line, using the user supplied format string. And so forth with the month and year on each line.

So, if the user supplied the above example j m Y format, I need to be able to display the date as such:

6

07

2018

I can't figure out how to see what the day of the month portion of the date format string is, and then display the day of the month (only) in that format.

For example, how can I extract the day portion of the user supplied format so that I can modify this line:

$ci_post_day   = date('d', strtotime( $ci_post_date ) ); // 01 - 31 day format

My question is how I determine what value to use in place of 'd' in the above line if the user has supplied another format for the day of month.