1. Go to this page and download the library: Download cyvax/privatebin_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/ */
cyvax / privatebin_php example snippets
use Cyvax\Clients\Privatebin;
$result = (new Privatebin())
->setUrl("https://privatebin.net/")
->setText("Because ignorance is bliss!")
->setExpire("1hour")
->encodeAndPost();
use Cyvax\Clients\Privatebin;
$result = Privatebin::init(
url: "https://privatebin.net/",
text: "Because ignorance is bliss!",
expire: "1hour",
)->encodeAndPost();
use Cyvax\Clients\PrivatebinSnakeCase;
$result = (new PrivatebinSnakeCase())
->set_url("https://privatebin.net/")
->set_text("Because ignorance is bliss!")
->set_expire("1hour")
->encode_and_post();
use Cyvax\Clients\Privatebin;
$result = (new Privatebin([
"url" => "https://privatebin.net/",
"text" => "Because ignorance is bliss!",
]))->encodeAndPost();
use Cyvax\Clients\Privatebin;
$result = (new Privatebin())
->setAttachment("/path/to/image.png")
->encodeAndPost();
use Cyvax\Clients\Privatebin;
$result = (new Privatebin())
->setUrl("https://local.privatebin/")
->setSslVerify(false)
->setText("Hello!")
->encodeAndPost();
use Cyvax\Clients\Privatebin;
$client = new Privatebin();
// Fetch and decrypt in one call
$data = $client->fetchAndDecrypt($pasteId, $b58);
echo $data['paste'];
// $data['attachment'] and $data['attachment_name'] are set if the paste had an attachment
use Cyvax\Contracts\PrivatebinClientInterface;
function postPaste(PrivatebinClientInterface $client): array {
return $client->setText("Hello!")->encodeAndPost();
}
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.