PHP string formatting function

Source: Internet
Author: User
PHP string formatting function
Function list:
  • convert_cyr_string()
  • crc32()
  • hebrev()
  • hebrevc()
  • money_format()
  • number_format()

  1. Echo convert_cyr_string ('The string', 'K', 'I ');

  1. $ Checksum = crc32 ("This is the string .");
  2. Printf ("% u \ n", $ checksum );

  1. // The hebrevc () function switches the flow of Hebrew text from right to left to the flow from left to right. It also converts the new line (\ n)
    .
  2. // Only ASCII characters between 224 and 251, and punctuation marks are affected.
  3. String hebrevc (string $ hebrew_text [, int $ max_chars_per_line = 0])

  1. $ Number = 9999.89;
  2. Setlocale (LC_MONETARY, 'en _ us ');
  3. Echo money_format ('% I', $ number );
  4. // Output: USD 9,999.89.

  1. $ Number = 9996.89;
  2. Echo number_format ($ number );
  3. # Output: 9,997
  4. Echo number_format ($ number, 2 ,',','');
  5. # Output: 9 996, 89

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.