1. Go to this page and download the library: Download chipslays/telegraph 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/ */
chipslays / telegraph example snippets
use Telegraph\Telegraph;
// Create client
$telegraph = new Telegraph;
// Create account
$account = $telegraph->createAccount(
shortName: 'MyBlog',
authorName: 'John Doe'
);
// IMPORTANT: Save this token!
$token = $account->accessToken();
// Create page
$page = $account->createPage(
title: 'Hello World',
content: 'My first Telegraph article!'
);
echo "Published: " . $page->url();