PHP code example of castle / castle-php

1. Go to this page and download the library: Download castle/castle-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

castle / castle-php example snippets




Castle::setApiKey('YOUR_API_SECRET');

Castle::setCurlOpts($curlOpts)

Castle::setUseAllowlist($headers)

Castle_RequestContext['ip'] = '1.1.1.1'
$context = Castle_RequestContext::extractJson();