Actually, there is a clean third way using built-in methods:

$params = array(‘http’=>array(‘method’=>’post’,’content’=>http_build_query($postArr)));
$context= stream_context_create($params);
$stream= fopen($url, ‘rb’, false, $context);