Answer the question
In order to leave comments, you need to log in
how to change string encoding in php?
Hello.
There is a php page. Text is written on it, for example the word "Hello"
It is necessary that any text that is written on the page in Cyrillic is automatically encoded in windows1251
The word Hello will look like this: =?windows-1251?B?z/Do4uXy?=
Suggestion: Hello . How are you? looks like this: =?windows-1251?B?z/Do4uXyLiDK4Oog5OXr4D8=?=
Also, I don’t understand how to then take a certain part of the page with encoded text and insert it into another php page (the include function inserts the entire page, but how to insert only a part?)
I rummaged through everything I can, but I can’t find anything. Thanks in advance for your replies
Answer the question
In order to leave comments, you need to log in
take a specific part of a page with encoded text and paste in another php page
// error.php
echo 'Error 404';
// index.php или любой другой .php
include 'error.php';
// api.php
function printError() {
echo 'Error 404';
}
// index.php или любой другой .php
include 'api.php'; // или requere, разницу см. на php.net
printError(); // любые функции из файла
$to = "=?windows-1251?B?" . base64_encode($_POST["username"]) . "?= <" . $_POST["mail"] . ">";
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question