1. Go to this page and download the library: Download jinomdeveloper/helpers 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/ */
jinomdeveloper / helpers example snippets
use Jinom\Helpers\Facades\Helpers;
// Price cho $taxService->basePrice; // 100000 (original price before tax)
echo $taxService->tax; // 11000 (tax amount)
echo $taxService->taxedPrice; // 111000 (total price with tax)
use Jinom\Helpers\Facades\Helpers;
// Base price without tax
$taxService = Helpers::tax(100000, false);
echo $taxService->basePrice; // 100000 (original price)
echo $taxService->tax; // 11000 (calculated tax)
echo $taxService->taxedPrice; // 111000 (total price with tax)
use Jinom\Helpers\Facades\Helpers;
echo Helpers::terbilang(1000000); // "Satu Juta Rupiah"
echo Helpers::terbilang(150000); // "Seratus Lima Puluh Ribu Rupiah"
echo Helpers::terbilang(25); // "Dua Puluh Lima Rupiah"
use Jinom\Helpers\Facades\Helpers;
echo Helpers::to_e164("081234567890"); // "+6281234567890"
echo Helpers::to_e164("0812-3456-7890"); // "+6281234567890"
echo Helpers::to_e164("62812345678"); // "+62812345678"
echo Helpers::to_e164("+6281234567890"); // "+6281234567890"
// With custom country code
echo Helpers::to_e164("081234567890", "1"); // "+181234567890"
use Jinom\Helpers\Helpers;
use Jinom\Helpers\Services\TaxService;
// Direct tax calculation
$taxService = new TaxService(111000, true);
// Using the main class
$helpers = new Helpers();
$taxService = $helpers::tax(111000, true);
// Currency formatting
echo $helpers::rupiah(1000000);
use Jinom\Helpers\Facades\Helpers;
// Product price displayed to customer (roduct Price: " . Helpers::rupiah($tax->basePrice); // "Rp 500.000"
echo "Tax (PPN 11%): " . Helpers::rupiah($tax->tax); // "Rp 55.000"
echo "Total Price: " . Helpers::rupiah($tax->taxedPrice); // "Rp 555.000"
echo "Amount in Words: " . Helpers::terbilang($tax->taxedPrice); // "Lima Ratus Lima Puluh Lima Ribu rupiah"
use Jinom\Helpers\Facades\Helpers;
// Customer input from form
$customerInput = [
'amount' => 'Rp 1.500.000',
'phone' => '0812-3456-7890'
];
// Parse and process
$amount = Helpers::rupiah_to_number($customerInput['amount']); // 1500000
$phone = Helpers::to_e164($customerInput['phone']); // "+6281234567890"
// Calculate with tax
$tax = Helpers::tax($amount, false);
echo "Final amount: " . Helpers::rupiah($tax->taxedPrice); // "Rp 1.665.000"
echo "Amount in words: " . Helpers::terbilang($tax->taxedPrice);
echo "Contact: " . $phone;
use Jinom\Helpers\Facades\Helpers;
// All methods available statically
$taxService = Helpers::tax(100000, false);
$formatted = Helpers::rupiah(100000);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.