PHP code example of wastukancana / nim

1. Go to this page and download the library: Download wastukancana/nim 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/ */

    

wastukancana / nim example snippets




use Wastukancana\Nim;
use Exception;

var_dump($nim->dump());
} catch (Exception $e) {
    echo $e->getMessage();
}

$student = (new Nim('211351143'))->dump();
/* object(Wastukancana\Student) {
    nim: "211351143",
    name: null,
    gender: null,
    isGraduated: null,
    admissionYear: 2021,
    study: "Teknik Informatika",
    educationLevel: "S1",
    firstSemester: 1,
    sequenceNumber: 143
} */

use Wastukancana\Nim;
use Wastukancana\Provider\PDDikti;
use Wastukancana\Provider\WastuFyi;

$nim = '211351143';

// Using PDDikti provider (pass FQCN)
$student = (new Nim($nim, PDDikti::class))->dump();

// Using Wastu.FYI provider (ue,
    admissionYear: 2021,
    study: "Teknik Informatika",
    educationLevel: "S1",
    firstSemester: 1,
    sequenceNumber: 143
} */