PHP code example of wongyip / phphelpers

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

    

wongyip / phphelpers example snippets


use Wongyip\PHPHelpers\Format;

// Format file sizes
echo Format::fileSize(1536); // "1.5 KB"

// Format dates
echo Format::MySQL(); // "2023-12-25 15:30:45"

// Convert strings
echo Format::camel('hello-world'); // "helloWorld"

// Format arrays to text
$data = ['name' => 'John', 'age' => 30];
echo Format::toText($data);
// name: John
// age : 30