PHP code example of tourze / gb-t-2261
1. Go to this page and download the library: Download tourze/gb-t-2261 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/ */
tourze / gb-t-2261 example snippets
use Tourze\GBT2261\Gender;
// Get enum value
$gender = Gender::MAN;
// Get label
echo $gender->getLabel(); // Output: 男
$genderOptions = Gender::getSelectOptions();
// Returns array suitable for dropdown menus
function processGender(Gender $gender): void
{
// Type-safe parameter ensures only valid Gender enum values
echo $gender->getLabel();
}