EMS express Waybill No Lenovo

Source: Internet
Author: User
Provides a variety of official and user-released code examples. For code reference, you are welcome to exchange and learn to give a ticket number, think of the next n ticket numbers
PHP version:

  
Print_r (EMS ('ek702111856cs ', 10 ));

Function EMS ($ code, $ num ){
If (! Preg_match ('/[a-z-A-Z] {2} [0-9] {9} [a-z-A-Z] {2}/', $ code )) die ('start value verification failed! Invalid EMS waybill number! ');
$ Start = (float) substr ($ code, 2, 8 );
For ($ I = 0; $ I <$ num; $ I ++ ){
$ A = (string) ($ start + $ I );
$ B = (11-($ a [0] * 8 + $ a [1] * 6 + $ a [2] * 4 + $ a [3] * 2 + $ a [4] * 3 + $ a [5] * 5 + $ a [6] * 9 + $ a [7] * 7) % 11 ));
$ B = $ B <10? $ B :( ($ B-10) * 5 );
$ Arr [] = $ code [0]. $ code [1]. $ a. $ B. $ code [11]. $ code [12];
}
Return $ arr;
}

?>
JavaScript version:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.