Home  >  Article  >  Backend Development  >  How to accomplish quoted-printable string conversion in PHP

How to accomplish quoted-printable string conversion in PHP

autoload
autoloadOriginal
2021-04-26 12:42:372171browse

How to accomplish quoted-printable string conversion in PHP

During the use of PHP, we may need to convert the 8-bit string into a quoted-printable string. In order to solve this problem If there is any trouble, we can use the quoted_printable_encode() function to complete this task. This article will take you to take a look.

First, let’s take a look at the syntax of the quoted_printable_encode() function:

quoted_printable_encode    ( string $str   )
  • str: ​​Input string.

  • Return value: Return the encoded string

Code example:

<?php
$str1="php.cn=2021";
echo $str1."<br>";
$str2=quoted_printable_encode($str1);
echo $str2;
?>
输出:php.cn=2021
       php.cn=3D2021

Recommendation: 2021 PHP interview questions summary (collection)》《php video tutorial

The above is the detailed content of How to accomplish quoted-printable string conversion in PHP. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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