PHP   25

test if the CURL extension is installed

Guest on 25th April 2022 01:17:55 AM

  1. <?php
  2. // Script to test if the CURL extension is installed on this server
  3. // Define function to test
  4.  
  5. function _is_curl_installed() {    
  6.  
  7. if  (in_array  (ā€˜curlā€™, get_loaded_extensions())) {        
  8.  
  9. return true;    
  10.  
  11. }    
  12.  
  13. else {        
  14.  
  15. return false;     // Ouput text to user based on test
  16.  on test
  17.  
  18. if (_is_curl_installed()) {
  19.  
  20. echo ā€œcURL is <span style=ā€¯color:blueā€¯>installed</span> on this serverā€¯;
  21.  
  22. } else {
  23.  
  24. echo ā€œcURL is NOT <span style=ā€¯color:redā€¯>ins

Raw Paste


Login or Register to edit or fork this paste. It's free.