4

I need to print curl version using this documnts :

<?PHP echo curl_version('version');?>

but my output is empty! how do can i print version number of curl?

Pink Code
  • 1,802
  • 7
  • 43
  • 65
  • error of string value –  Nov 06 '14 at 10:34
  • curl_version() expects parameter 1 to be long, string given – vaso123 Nov 06 '14 at 10:35
  • you must use : print_r(curl_version([int]), TRUE), or var_dump(curl_version([int])), while curl_version() return an associative array – Halayem Anis Nov 06 '14 at 10:37
  • strictly speaking: you can't print the version of curl, because you're not running curl, but you CAN print the version of **lib**curl, because you're running libcurl in your php installation :P – hanshenrik May 01 '19 at 20:16

2 Answers2

7
print_r(curl_version());    // remove your unexpected parameter
                            // also it returns an array , don't use echo. 

Fiddle

Edit after the comment

$values=curl_version();
echo $values["version"];

P.S: Of course you need to have cURL installed and enabled first.

Hanky Panky
  • 46,730
  • 8
  • 72
  • 95
1
<?php

$info = curl_version();
echo $info["version"];

?>
CS GO
  • 914
  • 6
  • 20