Answer the question
In order to leave comments, you need to log in
Why displays krakozyabry?
I use the code in PHP from under Windows 10
<?php
$data = 'help';
exec(escapeshellcmd($data), $output, $return);
echo implode("\n", $output)."\nReturn Code: $return";
?>
and it displays in the browser: Answer the question
In order to leave comments, you need to log in
If you use a PHP 5.6 server and higher, then you need to send an http header to the browser, in what encoding the script will give data, regardless of what encoding the script file itself is in, and even if you normally give the HTML structure of the document.
//установка кодировки вывода
header('Content-Type: text/html; charset=utf-8');
header('Content-Type: text/html; charset=CP866');
$data = 'help';
exec(escapeshellcmd($data), $output, $return);
echo implode("<br>", $output)."<br>Return Code: ".$return;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question