1. Go to this page and download the library: Download lithephp/swisshelper 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/ */
lithephp / swisshelper example snippets
// Get current DateTime object
$datetime = now();
// Get formatted current date
$formatted = now('Y-m-d H:i:s');
$date = now('Y-m-d');
$time = now('H:i:s');
// Default (16 characters, alphanumeric)
echo random(); // "a1B2c3D4e5F6g7H8"
// Specific length
echo random(8); // "Xa4Kp9Yz"
// Only letters
echo random(8, 'alpha'); // "AbCdEfGh"
// Only numbers
echo random(6, 'numeric'); // "123456"
// Numbers without zero
echo random(4, 'nozero'); // "1234"
// Get current URL
echo url()->current();
// Output: "https://example.com/current/path"
// Get base URL
echo url()->base();
// Output: "https://example.com"
// Generate URL
echo url()->to('products/1');
// Output: "https://example.com/products/1"
// Get previous URL
echo url()->previous();
// Output: Returns the previous URL or base URL if not available
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.