Skip to content

Instantly share code, notes, and snippets.

@Mikulas
Last active May 17, 2017 11:21
Show Gist options
  • Save Mikulas/9e07c684b1c5bf9dc6b310f5e50ad528 to your computer and use it in GitHub Desktop.
Save Mikulas/9e07c684b1c5bf9dc6b310f5e50ad528 to your computer and use it in GitHub Desktop.
<?php
$result = file_get_contents('http://example.com/submit.php', FALSE, stream_context_create([
'http' => [
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => http_build_query([
'foo' => 'bar',
]),
],
]));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment