Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,950 questions

51,892 answers

573 users

How to check if there is an https wrapper available in PHP

1 Answer

0 votes
$w = stream_get_wrappers();
echo 'openssl: ',  extension_loaded ('openssl') ? 'yes':'no', "<br />";
echo 'http wrapper: ', in_array('http', $w) ? 'yes':'no', "<br />";
echo 'https wrapper: ', in_array('https', $w) ? 'yes':'no', "<br />";
echo "<pre>";
echo 'wrappers: ', var_dump($w);
echo "</pre>";


/*
run:

openssl: yes
http wrapper: yes
https wrapper: yes

wrappers: array(11) {
  [0]=>
  string(3) "php"
  [1]=>
  string(4) "file"
  [2]=>
  string(4) "glob"
  [3]=>
  string(4) "data"
  [4]=>
  string(4) "http"
  [5]=>
  string(3) "ftp"
  [6]=>
  string(3) "zip"
  [7]=>
  string(13) "compress.zlib"
  [8]=>
  string(5) "https"
  [9]=>
  string(4) "ftps"
  [10]=>
  string(4) "phar"
}


*/

 



answered Jun 24, 2016 by avibootz

Related questions

1 answer 195 views
4 answers 282 views
1 answer 105 views
1 answer 114 views
1 answer 155 views
...