PHP code example of a-afsharfarnia / data-mapper

1. Go to this page and download the library: Download a-afsharfarnia/data-mapper 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/ */

    

a-afsharfarnia / data-mapper example snippets


    echo TimeMapper::mapData("1m");               --> result: 1 minute   (to map)
    echo TimeMapper::unmapData("12hours");        --> result: 12h        (to unmap)
 php
    public static $mapper = [
        "1m" => "1minute",
        "30m" => "30minutes",
        "1h" => "1hour",
        "8h" => "8hours",
        "12h" => "12hours",
        "1d" => "1day",
        "3d" => "3days",
        "1w" => "1week",
        "1M" => "1month"
    ];