PHP code example of mastersteelblade / discriminator
1. Go to this page and download the library: Download mastersteelblade/discriminator 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/ */
mastersteelblade / discriminator example snippets
use Steelblade/Discriminator/Discriminator;
$discriminator = new Discriminator();
$intVal = $discriminator->get();
$discriminator = Discriminator::generate();
class User {
private $ID;
private $emailAddress;
public $nickname;
public $discriminator;
...
public function login($emailAddress, $password) {
// Retrieve the user from the database and verify their password.
if ($successfulLogin) {
$this->emailAddress = $databaseRow['email'];
$this->nickname = $databaseRow['nickname'];
$this->discriminator = new Discriminator($databaseRow['discriminator']);
}
}
}
return "The discriminator for $user->nickname is $user->discriminator";
// The discriminator for Master Steelblade is 0451
$integer = 47;
$discriminator = Discriminator::format($integer);
// Returns 0047 as a string
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.