<?php
ob_start();
passthru('ls 2>&1');
$result = ob_get_clean();
echo $result;
<?php
$bytes = '208,159,209,128,208,184,208,178,208,181,209,130,44,32,208,188,208,184,209,128';
$str = "";
foreach(explode(',', $bytes) as $code) {
$str .= chr($code);
}
var_dump($str);
//string(20) "Привет, мир"
<?php
$str = "Привет, мир";
$bytes = [];
foreach(str_split($str) as $char) {
$bytes[] = ord($char);
}
echo join(',', $bytes);
//208,159,209,128,208,184,208,178,208,181,209,130,44,32,208,188,208,184,209,128
'Authorization:'
curl_setopt($curlhandle, CURLOPT_VERBOSE, true);
$stream = @stream_socket_server('tcp://0.0.0.0:7600', $errno, $errmg) ;
if(!$stream) {
echo "A copy of the script is already running!" . PHP_EOL;
exit;
}
echo '<tr><td nowrap="nowrap" data-sort="2020-04-01">';
echo $date;
echo '</td><td>';
Взаимодействие через API
-> 1. Выставление счета
"payUrl": "https://oplata.qiwi.com/form/?invoice_uid=...
//..
$hash_list = [];
while ($row = mysqli_fetch_array($result)) {
$response[$count]= json_encode(unserialize($row[0]));
$count +=1;
//собираем все hash в один список
$hash_list[] = $row[1];
}
//апдейтим все pictures по списку hash одним запросом
if(!empty($hash_list)) {
mysqli_query ($db, "
UPDATE `pictures` SET `result`='PROCESS'
WHERE `hash` IN('".join("','", $hash_list)."')
");
}
echo json_encode($response);