PHP code example of morvren-achronos / useful

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

    

morvren-achronos / useful example snippets


// Create a Useful Date object
$oDate = \Useful\Date::create('1999-12-31');

// Load Useful autoloader directly
Date = \Useful\Date::create('1999-12-31');

// Load Useful legacy autoloader
$oDate = Useful_Date::create('1999-12-31');

// Load Useful_Legacy_Loader class
space(
	'\Useful',
	'WHEREVER_YOU_PUT_VENDOR_CODE/useful/src/Useful',
	'WRITABLE_TEMP_DIRECTORY_FOR_CODE_CACHING/'
);

function __autoload($sClass)
{
	// Try Useful legacy loader, it will return FALSE if not handled.
	// You could also just call this method directly for each class you want, without an autoloader.
	if (Useful_Legacy_Loader::loadClass($sClass)) {
		return;
	}

	// ... whatever else you need to autoload
}

// Create a Useful Date object
$oDate = Useful_Date::create('1999-12-31');
sh
git clone https://github.com/morvren-achronos/php-useful.git WHEREVER_YOU_PUT_VENDOR_CODE/useful