PHP string formatting function

WBOY
Release: 2016-07-25 09:09:16
Original
771 people have browsed it
Function list:
  • convert_cyr_string()
  • crc32()
  • hebrev()
  • hebrevc()
  • money_format()
  • number_format()
  1. echo convert_cyr_string('The string', 'k','i');
Copy code
  1. $checksum = crc32("This is the string.");
  2. printf("%un", $checksum);
Copy code
  1. //hebrevc() function converts Hebrew text from right-to-left flow to left-to-right flow. It also converts newlines (n) to
    .
  2. //Only ASCII characters between 224 and 251, and punctuation are affected.
  3. string hebrevc ( string $hebrew_text [, int $max_chars_per_line = 0 ] )
Copy code
  1. $number = 9999.89;
  2. setlocale(LC_MONETARY, 'en_US');
  3. echo money_format('%i', $number);
  4. // Output : USD 9,999.89
Copy code
  1. $number = 9996.89;
  2. echo number_format($number);
  3. # Output : 9,997
  4. echo number_format($number, 2, ',', ' ');
  5. # Output : 9 996,89
Copy code


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!