diff --git a/templates/docs/php.html b/templates/docs/php.html index b7c3bfbe..d975ff24 100644 --- a/templates/docs/php.html +++ b/templates/docs/php.html @@ -1,4 +1,23 @@
Below is an example of making a HTTP request to SITE_NAME from PHP.
-file_get_contents('https://hc-ping.com/your-uuid-here');
-
file_get_contents('PING_URL');
+
If you would like to setup timeout and retry options, as discussed in the +reliability tips section, there is a +curl package available that lets you do that easily:
+```php startinline=True +use Curl\Curl;
+$curl = new Curl(); +$curl->setRetry(20); +$curl->setTimeout(5); +$curl->get('PING_URL'); +```
+:::php +use Curl\Curl; +$curl = new Curl(); +$curl->setRetry(20); +$curl->setTimeout(5); +$curl->get('PING_URL');
+Note: this code never throws any exception.
\ No newline at end of file diff --git a/templates/docs/php.md b/templates/docs/php.md index 4efa19e9..b84da268 100644 --- a/templates/docs/php.md +++ b/templates/docs/php.md @@ -3,10 +3,12 @@ Below is an example of making a HTTP request to SITE_NAME from PHP. ```php -file_get_contents('https://hc-ping.com/your-uuid-here'); +file_get_contents('PING_URL'); ``` -If you'd like to setup timeout and retry options, as discussed in the [reliability tips section](../reliability_tips/), there is a [curl package](https://www.phpcurlclass.com/) available that lets you do that easily: +If you would like to setup timeout and retry options, as discussed in the +[reliability tips section](../reliability_tips/), there is a +[curl package](https://www.phpcurlclass.com/) available that lets you do that easily: ```php use Curl\Curl; @@ -14,7 +16,7 @@ use Curl\Curl; $curl = new Curl(); $curl->setRetry(20); $curl->setTimeout(5); -$curl->get('https://hc-ping.com/your-uuid-here'); +$curl->get('PING_URL'); ``` Note: this code never throws any exception.