Skip to content

pltext/pltextphp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PLText PHP Client

A simple PHP wrapper for the PLText API.

Installation

You can install the package via Composer.

composer require pltext/sdk

Usage

First, ensure you have your PLText API key. You can provide it directly or load it from a .env file using a library like vlucas/phpdotenv.

require 'vendor/autoload.php';

use Dotenv\Dotenv;
use Pltext\Pltext;

// Example of loading from a .env file
$dotenv = Dotenv::createImmutable(__DIR__);
$dotenv->load();
$apiKey = $_ENV['PLTEXT_API_KEY'];

// Or, provide the key directly:
$apiKey = "your_pltext_api_key_here";
$client = new Pltext($apiKey);

$content = "This is the text content you want to check for plagiarism.";

try {
    $result = $client->checkContent($content);
    print_r($result);
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}

Local Development

For local development, you can create a .env file in the project root. Your application code (like in example.php) is responsible for loading these variables.

PLTEXT_API_KEY=your_pltext_api_key_here
PLTEXT_API_URL=http://localhost:5033/api/v1/check

About

A pltext wrapper for api.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages