A
A
Artamov2018-09-17 15:50:59
PHP
Artamov, 2018-09-17 15:50:59

How to process raw data in PHP?

Hello, I can not understand what the problem is, there is a script with the following content:

$handler = fopen('php://input', 'r');
$data = json_decode(stream_get_contents($handler), true);
var_dump($data);

I check everything locally through Postman, but nothing works on the server, I tried a lot of things, nothing comes out

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Den Korolev, 2018-09-17
@Kodenkos

Look at the allow_url_fopen setting, it should be 1

F
frees2, 2018-09-17
@frees2

100% server, let the hackers go...

curl_exec($ch);   $xmlData = curl_exec($ch);  if ($xmlData!== false) {setlocale(LC_ALL, 'ru_RU.utf8');
 Header("Content-Type: text/html;charset=UTF-8"); $sxml = simplexml_load_string($xmlData);
print_r($sxml);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question