I am trying to generate a pre-format “Roll Number” in a text field The code is :
<input type="text" class="form-control" name="student_code" value="<?php echo substr(md5(uniqid(rand(), true)), 0, 7); ?>" data-validate="required" id="class_id" data-message-required="<?php echo get_phrase('value_required');?>">
In the above code it generate a random ID, But my specific requirement is “XYZ/serial_Number/Current_Year”
It should be in this format … XYZ(constant prefix text)/Serial Number(0001)/Current_year(2019)