note 78746 deleted from function.curl-init by salathe
| From: | salathe@php.net | Date: | Mon, 21 Sep 2020 14:46:53 +0000 |
| Subject: | note 78746 deleted from function.curl-init by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215304@lists.php.net to get a copy of this message | ||
Note Submitter: rossixx at gmx dot net
----
e.g. you can check how many characters are on test_1.php
or you can it use for more, i have used this function for a nagios check.
<?PHP
echo "CURL - function test <br>" ;
if ($load == 1){
function webcheck ($url) {
$ch = curl_init ($url) ;
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1) ;
$res = curl_exec ($ch) ;
curl_close ($ch) ;
return ($res) ;
}
echo "url = $url <br>" ;
$erg = webcheck("my_page.php/test_1.php") ;
$zahl = strlen ($erg) ;
echo "length = $zahl " ;
?>