Following are my code that return expiry time of token and some other login info.
include_once('vendor/copyleaks/php-plagiarism-checker/autoload.php');
use Copyleaks\Copyleaks;
$copyleaks = new Copyleaks();
$loginResult = $copyleaks->login('[email protected]','My-Api-Key Here');
echo json_encode($loginResult);
My Answer:
To pass a variable to check plagiarism in Copyleaks API using PHP, you can use the following code:
php
include_once('vendor/copyleaks/php-plagiarism-checker/autoload.php');
use Copyleaks\Copyleaks;
$copyleaks = new Copyleaks();
$loginResult = $copyleaks->login('[email protected]','My-Api-Key Here');
// Pass the variable to check plagiarism
$text = "Your text to check for plagiarism";
$scanResult = $copyleaks->createByText($text);
echo json_encode($scanResult);
In the above code, the variable `$text` contains the text that you want to check for plagiarism. You can replace the placeholder text with your actual text. The `createByText` method is used to check plagiarism for the provided text. The result of the plagiarism check will be stored in the `$scanResult` variable, which can be encoded as JSON and returned.
Rate this post
5 of 5 based on 3876 votesComments