PHP code example of josantonius / datatype
1. Go to this page and download the library: Download josantonius/datatype 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/ */
josantonius / datatype example snippets
DataType::objectToArray($object);
use Josantonius\DataType\DataType;
use Josantonius\DataType\DataType;
$object = new \stdClass();
$object->name = 'Josantonius';
$object->email = '[email protected]';
$object->url = 'https://github.com/josantonius/PHP-DataType';
echo '<pre>'; var_dump(DataType::objectToArray($object)); echo '</pre>';
/*
array(3) {
["name"]=>
string(11) "Josantonius"
["email"]=>
string(20) "[email protected]"
["url"]=>
string(36) "https://github.com/josantonius/PHP-DataType"
}
*/