Answer the question
In order to leave comments, you need to log in
Why doesn't the ASSIGNMENT OPERATOR work!?
Hello. There is a code:
if(!empty($_GET['dost_index']) && !empty($_GET['dost_address']))
{
$dost_index = (int)$_GET['dost_index'];
$dost_index = (string)$dost_index;
$dost_address = substr(str_replace(array('"', '`', "'", '\\'), '', trim(strip_tags($_GET['dost_address']))), 0, 1500);
$dost_res = 'Индекс: '.$dost_index."\n".'Адрес: '.$dost_address."\n";
}
$xml .= "Способ доставки: Доставка почтой россии!\n";
$like_mail .= "Способ доставки: Доставка почтой россии!\n";
$xml .= "\nКомментарий\n".iconv("windows-1251","utf-8", $_GET['comment'])."\n";
$like_mail .="\nКомментарий\n".iconv("windows-1251","utf-8", $_GET['comment'])."\n";
if(!empty($dost_res))
{
$xml .= iconv("windows-1251", "utf-8", $dost_res);
$like_mail .= iconv("windows-1251", "utf-8", $dost_res);
}
Answer the question
In order to leave comments, you need to log in
1. do this:
var_dump($dost_res);
var_dump(iconv("windows-1251", "utf-8", $dost_res));
$like_mail .= iconv("windows-1251", "utf-8", $dost_res);
2. run the script.
what brought it out?
99% that dost_res is empty or cannot be adequately converted from windows-1251 to utf-8
Look at the error log. Most likely, some wrong character got into $dost_res, and //TRANSLIT or //IGNORE should be used.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question