Way to detect curl present?

Discussion in 'PHP' started by johnwerry, Sep 29, 2008.

  1. #1
    I have two hosting providers and one installs curl by default and the other does not but I want a single codebase to be able to run in both servers without maintaining two versions.

    Is there a way to detect at runtime whether curl is present so that I can make the proper call one way or the other?

    Based on whether it is there I'm using:

    curl_get_file_contents
    vs.
    file_get_contents
     
    johnwerry, Sep 29, 2008 IP
  2. sastro

    sastro Well-Known Member

    Messages:
    214
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #2
    Try PHP snoopy to parse url. It use fopen, curl, file_get_contents and fsockopen.
     
    sastro, Sep 29, 2008 IP