Could you help me change this short piece of code to ASP? thank you!

Source: Internet
Author: User
Could you help me change this short piece of code to ASP? thank you!
Function flashdata_decode ($ s) {$ r = ''; $ l = strlen ($ s); for ($ I = 0; $ I <$ l; $ I = $ I + 2) {$ k1 = ord ($ s [$ I])-48; $ k1-= $ k1> 9? 7: 0; $ k2 = ord ($ s [$ I + 1])-48; $ k2-= $ k2> 9? 7: 0; $ r. = chr ($ k1 <4 | $ k2);} return $ r ;}

I am not familiar with PHP, so I cannot do it. thank you!
Mainly $ r. = chr ($ k1 <4 | $ k2); this line does not know how to change


Reply to discussion (solution)

PHP strlen function
ASP len functions

PHP ord functions
ASP asc functions

PHP | operator
ASP or operator

PHP <right shift operator
ASP is not replaced by concatenation 2. For example, <4 is * 2*2.

PHP $ s [$ I]
ASP mid (s, I, 1)

Thank you very much. those have already been translated. However, the chr of PHP is different from the chr/chrw of ASP. is ASP converted? What should I do?

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.