如何在php中创建顺序参考号?

can you guys give me an example on how to create a sequential reference number whenever the form is submitted. for example when the user create a account there is a textbox there where the reference number is already output. it will be better if the reference number is starts from 2018-0001. and i want it also to store it into my database.

<div class="col col-md-6">
                                    <div class="form-group">
                                        Reference: 
                                        <?php       

                                        ?>
                                        <input type="text" name="reference" id="refence" class="form-control" value="<?php  echo $reference; ?>"
                                        />
                                        <span class="text-danger">
                                            <?php if (isset($reference_error)) echo $reference_error; ?>
                                        </span>
                                    </div>
                                </div>

that is my code for my textbox.

I already edited my file just want to see 1 number at a time please check the image below.

my form

here's my code to edit

<div class="col col-md-6">
                                    <div class="form-group">
                                        Reference: 
                                        <?php       
                                            $number = 1;
                                        ?>
                                        <input type="text" name="reference" id="refence" class="form-control" value="<?php  while ($number <= 10) {
                                            echo str_pad ($number, 12, '2018-000000', STR_PAD_LEFT),' ';
                                            $number++;
                                            } ?>"
                                        />
                                        <span class="text-danger">
                                            <?php if (isset($reference_error)) echo $reference_error; ?>
                                        </span>
                                    </div>
                                </div>