• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

PHP function convert_cyr_string() – Convert from one Cyrillic character set to another

by admin

The convert_cyr_string() function is used to convert a string from one Cyrillic character-set to another set. It was introduced in PHP3. The character sets to be converted are specified with a single character code. Look at the types that are supported by this function:

“k - koi8-r
“w - windows-1251 “i - iso8859-5
“a - x-cp866
“d - x-cp866
“m - x-mac-cyrillic

If an invalid code is specified for the source and/or destination argument, the function generates a warning.

Note: The presence of a null byte (\0) in the string halts the translation at that point.

Syntax:

convert_cyr_string(string $str, string $from, string $to): string

Parameters

Parameter Description
str The string to be converted.
from The source Cyrillic character set, as a single character.
to The target Cyrillic character set, as a single character.

Return Values

Returns the converted string.

Filed Under: PHP

Some more articles you might also be interested in …

  1. PHP base_convert function – Convert a number between arbitrary bases
  2. PHP cos function – Cosine
  3. PHP function abs – Absolute value
  4. “Access denied for user ‘username’@’hostname’ (using password: YES)” – Error while connecting MySQL with PHP
  5. htaccess Cheatsheet
  6. PHP function acos – Arc cosine
  7. PHP atan function – Arc tangent
  8. PHP function stripcslashes() – Un-quote string quoted with addcslashes()
  9. PHP decbin function – Decimal to binary
  10. PHP function bin2hex – Convert binary data into hexadecimal representation

You May Also Like

Primary Sidebar

Recent Posts

  • fprintd-delete Command Examples in Linux
  • fprintd-delete: command not found
  • foreman: command not found
  • foreman Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright