我希望这段代码在实际计数和年份之间有几个零

Can someone tell me how I can make the following script output: 2015000001 and then 201500002. Now it gives 20151 en 20152 etc. This script counts my form submissions on contact form 7 on wordpress so each email gets a unique incrementing number but I want the counting to start after 4 or 5 zeros. So 201500001

//Define the key to store in the database
define( 'CF7_COUNTER', 'cf7-counter' );

//Create the shortcode which will set the value for the DTX field
function cf7dtx_counter(){
$val = date( 'Y' ) . get_option( CF7_COUNTER, 0) + 1; //Increment the current count
return $val;
}
add_shortcode('CF7_counter', 'cf7dtx_counter');

//Action performed when the mail is actually sent by CF7
function cf7dtx_increment_mail_counter(){
$val = get_option( CF7_COUNTER, 0) + 1; //Increment the current count
update_option(CF7_COUNTER, $val); //Update the settings with the new count
}
add_action('wpcf7_mail_sent', 'cf7dtx_increment_mail_counter');

Thanks for the help so far. BTW does anyone know how I can reset the number back to zero so it starts counting all over again.

I have it from this article so you can check: http://sevenspark.com/tutorials/how-to-create-a-counter-for-contact-form-7

Regards, Amro

function cf7dtx_counter(){
    $year = date('Y');
    $counter = get_option( CF7_COUNTER, 0) + 1;
    $val = sprintf('%d%05d', $year, $counter);
    return $val;
}

The second value ($counter) will be padded with 0 characters to a total length of 5 characters, that's what the %05d does.

Sımply change this line

$val = date( 'Y' ) . get_option( CF7_COUNTER, 0) + 1; //Increment the current count

to;

$val = date( 'Y' )*100000 + (get_option( CF7_COUNTER, 0) + 1); //Increment the current count

to update the counter variable you have to call this function

update_option(CF7_COUNTER, 0); //Update the settings with the new count