PHP code example of simplepie / utility-pack
1. Go to this page and download the library: Download simplepie/utility-pack 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' );
simplepie / utility-pack example snippets
use SimplePie \UtilityPack \Util \QueryString ;
echo QueryString::build([
'limit' => 'a' ,
'order' => 'b' ,
'offset' => 'c' ,
]);
use SimplePie \UtilityPack \Util \Time ;
echo sprintf('%s, %s, %s' , 1 * Time::SECOND, 2 * Time::SECONDS, 10 * Time::SECONDS);
echo sprintf('%s, %s, %s' , 1 * Time::MINUTE, 2 * Time::MINUTES, 10 * Time::MINUTES);
echo sprintf('%s, %s, %s' , 1 * Time::HOUR, 2 * Time::HOURS, 10 * Time::HOURS);
echo sprintf('%s, %s, %s' , 1 * Time::DAY, 2 * Time::DAYS, 10 * Time::DAYS);
echo sprintf('%s, %s, %s' , 1 * Time::WEEK, 2 * Time::WEEKS, 10 * Time::WEEKS);
echo 0.5 * Time::YEAR;
use SimplePie \UtilityPack \Util \Time ;
echo gmdate(Time::FORMAT_ISO8601_ZULU);
use SimplePie \UtilityPack \Util \Types ;
echo Types::getClassOrType(
new \SimpleXMLElement('<xml/>' )
);
echo Types::getClassOrType(
new DateTime(
'now' ,
new DateTimeZone('UTC' )
)
);
echo Types::getClassOrType('string' ));
echo Types::getClassOrType(111 ));
echo Types::getClassOrType(111.0 ));
echo Types::getClassOrType(true ));
echo Types::getClassOrType(false ));