Source Code:
(back to article)
<?php $url = 'https://jsonplaceholder.typicode.com/posts'; $options = [ 'http' => [ 'method' => 'GET', 'header' => 'Content-type: application/x-www-form-urlencoded', ], ]; $context = stream_context_create($options); $data = file_get_contents($url, false, $context); echo $data;
Result:
Report an issue