I have to write some PHP code to make a post request to an external server and got two different examples from the server owners, one using "ssl://" and the other "https://" in the URL.
Can they be used interchangeably? Where would this be documented? Thank you!
EDIT to include PHP code (not sure why I can't format the code properly, if someone can help with explaining how to incorporate the initial comment in the code block):
// make a http post request to an external server
function httpPost($host, $usepath, $postdata = "") {
$fp = fsockopen($host, 443, $errno, $errstr, 60);
if( !$fp ) {
print "$errstr ($errno)<br>
";
}
else {
fwrite( $fp, "POST $usepath HTTP/1.0
");
$strlength = strlen( $postdata );
fwrite( $fp, "Content-type: application/x-www-form-urlencoded
" );
fwrite( $fp, "Content-length: ".$strlength."
" );
fwrite( $fp, $postdata."
" );
$output = "";
while( !feof( $fp ) ) {
$output .= fgets( $fp, 1024);
}
fclose( $fp);
}
return $output;
}