PHP code example of liasica / yii2-helpers

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

    

liasica / yii2-helpers example snippets


$xml = new ArrayToXML();
print $xml->buildXML($array);

$xml = new SimpleArrayToXml($redpack->redpackData);
var_dump($xmlmodel->buildXML());

$curl = new Curl($url);
var_dump($curl->Get());

$curl = new Curl($url);
$curl->setData($data);
var_dump($curl->Post());

$certs = [
    CURLOPT_SSLCERT => 'CURLOPT_SSLCERT.pem',
    CURLOPT_SSLKEY  => 'CURLOPT_SSLKEY.pem',
];
$curl = new Curl($url);
$curl->setData($data)->setCerts($certs);
var_dump($curl->postSSL());

$unicode = new Unicode(null, $unicodeStr);
var_dump($unicode->encode());

$unicode = new Unicode($encodeUnicodeStr);
var_dump($unicode->decode());

$radom = new Radom();
var_dump($radom->RadomChars(32));

$proArr = [1 => 1, 2 => 10, 3 => 40];
$radom = new Radom();
var_dump($radom->lottery($proArr));

$Url = new Url($uri);
var_dump($Url->realurl());

$Url = Url::setUri($uri);
var_dump($Url->realurl());

$Time = new Time();
var_dump($Time->microtime_format);

$Time = new Time();
var_dump($Time->microtime_float());