PHP code example of lib16 / utils

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

    

lib16 / utils example snippets



Lib16\Utils\Enums\CSS\{LengthUnit, AngleUnit, TimeUnit, FrequencyUnit};

print 1 . LengthUnit::EM() . ' ';
print 2 . LengthUnit::EX() . ' ';
print 2 . LengthUnit::CH() . ' ';
print 6 . LengthUnit::REM() . "\n";

print 50 . LengthUnit::VW() . ' ';
print 50 . LengthUnit::VH() . ' ';
print 50 . LengthUnit::VMIN() . ' ';
print 50 . LengthUnit::VMAX() . "\n";

print 2.54 . LengthUnit::CM() . ' ';
print 25.4 . LengthUnit::MM() . ' ';
print 101.6 . LengthUnit::Q() . ' ';
print 1 . LengthUnit::IN() . ' ';
print 6 . LengthUnit::PC() . ' ';
print 72 . LengthUnit::PT() . ' ';
print 96 . LengthUnit::PX() . "\n";

print 150 . LengthUnit::PERCENT() . ' ';
print 1.5 . LengthUnit::NONE() . "\n";

print 90 . AngleUnit::DEG() . ' ';
print 100 . AngleUnit::GRAD() . ' ';
print 1.57 . AngleUnit::RAD() . ' ';
print 0.25 . AngleUnit::TURN() . "\n";

print 0.5 . TimeUnit::S() . ' ';
print 500 . TimeUnit::MS() . "\n";

print 1 . FrequencyUnit::KHZ() . ' ';
print 1000 . FrequencyUnit::HZ();


Lib16\Utils\Enums\CSS\Media;

print Media::ALL() . ' ';
print Media::BRAILLE() . ' ';
print Media::EMBOSSED() . ' ';
print Media::HANDHELD() . ' ';
print Media::PRINT() . ' ';
print Media::PROJECTION() . ' ';
print Media::SCREEN() . ' ';
print Media::SPEECH() . ' ';
print Media::TTY() . ' ';
print Media::TV();



Lib16\Utils\Enums\Mime\{ImageType, IconType, VideoType, AudioType, StyleType};

print ImageType::GIF()->getFilenameExtension() . ': ';
print ImageType::GIF() . "\n";
print ImageType::JPG()->getFilenameExtension() . ': ';
print ImageType::JPG() . "\n";
print ImageType::PNG()->getFilenameExtension() . ': ';
print ImageType::PNG() . "\n";
print ImageType::SVG()->getFilenameExtension() . ': ';
print ImageType::SVG() . "\n\n";

print IconType::GIF()->getFilenameExtension() . ': ';
print IconType::GIF() . "\n";
print IconType::ICO()->getFilenameExtension() . ': ';
print IconType::ICO() . "\n";
print IconType::PNG()->getFilenameExtension() . ': ';
print IconType::PNG() . "\n";
print IconType::SVG()->getFilenameExtension() . ': ';
print IconType::SVG() . "\n\n";

print VideoType::MP4()->getFilenameExtension() . ': ';
print VideoType::MP4() . "\n";
print VideoType::OGV()->getFilenameExtension() . ': ';
print VideoType::OGV() . "\n";
print VideoType::WEBM()->getFilenameExtension() . ': ';
print VideoType::WEBM() . "\n\n";

print AudioType::AAC()->getFilenameExtension() . ': ';
print AudioType::AAC() . "\n";
print AudioType::MP3()->getFilenameExtension() . ': ';
print AudioType::MP3() . "\n";
print AudioType::OGG()->getFilenameExtension() . ': ';
print AudioType::OGG() . "\n";
print AudioType::WAV()->getFilenameExtension() . ': ';
print AudioType::WAV() . "\n\n";

print StyleType::CSS()->getFilenameExtension() . ': ';
print StyleType::CSS() . "\n";
print StyleType::XSL()->getFilenameExtension() . ': ';
print StyleType::XSL();



Lib16\Utils\NumberFormatter;
use Lib16\Utils\Enums\CSS\LengthUnit;

$formatter = new NumberFormatter(2);
print $formatter->format(100 / 6, LengthUnit::PX());