- Quoted_printable_decode()
- Php quoted printable decode
- convert.base64-encode и convert.base64-decode
- convert.quoted-printable-encode и convert.quoted-printable-decode
- convert.iconv.*
- PHP: quoted_ printable_ decode() function
- PHP: Tips of the Day
- quoted_printable_decode() function in PHP
- Syntax
- Parameter
- Return
- Example
- Output
- Annual Membership
- Training for a Team
Quoted_printable_decode()
Our article is about the PHP function quoted_printable_decode() , which is used to decode a quoted-printable string. This function is useful for working with email messages in PHP. In this article, we will discuss the syntax and usage of quoted_printable_decode() , as well as provide some examples.
The quoted_printable_decode() function is used to decode a quoted-printable string. The syntax of the quoted_printable_decode() function is as follows:
string quoted_printable_decode ( string $str )
The function takes one parameter, $str . The $str parameter is the quoted-printable string to be decoded.
Here is an example of how to use the quoted_printable_decode() function:
$string = 'Hello=20World!'; echo quoted_printable_decode($string); ?>
In this example, we have a string variable $string containing a quoted-printable string. We use the quoted_printable_decode() function to decode the string.
The output of this code will be:
As you can see, the quoted_printable_decode() function has decoded the quoted-printable string into a regular string.
The quoted_printable_decode() function is a useful tool for working with email messages in PHP. It can help you decode quoted-printable strings, which is useful for various purposes such as email message manipulation and validation. By mastering this function, you can become a more proficient PHP developer.
We hope this article has been helpful in understanding the quoted_printable_decode() function in PHP.
Php quoted printable decode
Как и фильтры string.*, фильтры convert.* совершают действия, соответствующие их именам. Для получения дополнительной информации о конкретном фильтре, обратитесь к странице руководства соответствующей функции.
convert.base64-encode и convert.base64-decode
Использование этих фильтров эквивалентно обработке всех данных потока функциями base64_encode() и base64_decode() соответственно. convert.base64-encode поддерживает аргументы, переданные в виде ассоциативного массива. Если указан аргумент line-length , результат base64 будет разделён на куски длинной line-length символов каждый. Если указан аргумент line-break-chars , каждый кусок будет разделён указанными символами. Эти параметры дают такой же эффект, как и использование base64_encode() в паре с chunk_split() .
Пример #1 convert.base64-encode и convert.base64-decode
$fp = fopen ( ‘php://output’ , ‘w’ );
stream_filter_append ( $fp , ‘convert.base64-encode’ );
fwrite ( $fp , «This is a test.\n» );
fclose ( $fp );
/* Выведет: VGhpcyBpcyBhIHRlc3QuCg== */
?php
$param = array( ‘line-length’ => 8 , ‘line-break-chars’ => «\r\n» );
$fp = fopen ( ‘php://output’ , ‘w’ );
stream_filter_append ( $fp , ‘convert.base64-encode’ , STREAM_FILTER_WRITE , $param );
fwrite ( $fp , «This is a test.\n» );
fclose ( $fp );
/* Выведет: VGhpcyBp
: cyBhIHRl
: c3QuCg== */
$fp = fopen ( ‘php://output’ , ‘w’ );
stream_filter_append ( $fp , ‘convert.base64-decode’ );
fwrite ( $fp , «VGhpcyBpcyBhIHRlc3QuCg= color: #007700″>);
fclose ( $fp );
/* Выведет: This is a test. */
?>
convert.quoted-printable-encode и convert.quoted-printable-decode
Использование decode-версии этого фильтра эквивалентно обработке всех данных потока функцией quoted_printable_decode() . У фильтра convert.quoted-printable-encode нет эквивалентной функции. convert.quoted-printable-encode поддерживает аргументы, переданные в виде ассоциативного массива. В дополнение к аргументам, поддерживаемыми convert.base64-encode , convert.quoted-printable-encode также поддерживает boolean-аргументы binary и force-encode-first . convert.base64-decode поддерживает лишь аргумент line-break-chars в качестве подсказки для чистки закодированных данных.
Пример #2 convert.quoted-printable-encode & convert.quoted-printable-decode
$fp = fopen ( ‘php://output’ , ‘w’ );
stream_filter_append ( $fp , ‘convert.quoted-printable-encode’ );
fwrite ( $fp , «This is a test.\n» );
/* Выведет: =This is a test.=0A */
?>?php
convert.iconv.*
Фильтры convert.iconv.* доступны в том случае, если включена поддержка iconv и их использование аналогично обработке потоковых данных с помощью iconv() . Эти фильтры не поддерживают параметров. Вместо этого ожидается, что исходная и целевая кодировки были заданы в имени фильтра таким образом: convert.iconv.. или convert.iconv./ (оба варианта семантически эквивалентны).
Пример #3 convert.iconv.*
$fp = fopen ( ‘php://output’ , ‘w’ );
stream_filter_append ( $fp , ‘convert.iconv.utf-16le.utf-8’ );
fwrite ( $fp , «T\0h\0i\0s\0 \0i\0s\0 \0a\0 \0t\0e\0s\0t\0.\0\n\0» );
fclose ( $fp );
/* Выведет: This is a test. */
?>?php
PHP: quoted_ printable_ decode() function
The quoted_printable_decode() function is used to convert a quoted-printable string to an 8-bit string.
quoted_printable_decode(input_string)
Return value:
Returns the 8-bit binary string.
Value Type: String.
Pictorial Presentation
Previous: printf
Next: quotemeta
Follow us on Facebook and Twitter for latest update.
PHP: Tips of the Day
Detecting request type in PHP (GET, POST, PUT or DELETE)
if ($_SERVER['REQUEST_METHOD'] === 'POST') < // The request is using the POST method >
For more details please see the documentation for the $_SERVER variable.
- Weekly Trends
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
- JavaScript functions Exercises
- Python Tutorial
- Python Array Exercises
- SQL Cross Join
- C# Sharp Array Exercises
We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook
quoted_printable_decode() function in PHP
The quoted_printable_decode() is used to convert the quoted printable string to 8 bit string.
Syntax
quoted_printable_decode(str)
Parameter
Return
The quoted_printable_decode() function returns the 8-bit ASCII string.
Example
The following is an example −
Output
- Related Articles
- filter_has_var() function in PHP
- filter_id() function in PHP
- filter_input() function in PHP
- filter_input_array() function in PHP
- filter_list() function in PHP
- filter_var_array() function in PHP
- filter_var() function in PHP
- constant() function in PHP
- define() function in PHP
- defined() function in PHP
- die() function in PHP
- eval() function in PHP
- exit() function in PHP
- get_browser() function in PHP
- highlight_file() function in PHP
Annual Membership
Enjoy unlimited access on 5500+ Hand Picked Quality Video Courses
Training for a Team
Affordable solution to train a team and make them project ready.
- About us
- Refund Policy
- Terms of use
- Privacy Policy
- FAQ’s
- Contact
Copyright © Tutorials Point (India) Private Limited. All Rights Reserved.
We make use of First and third party cookies to improve our user experience. By using this website, you agree with our Cookies Policy. Agree Learn more