1. Go to this page and download the library: Download keven/hydrate 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/ */
$car = new Car(array(
'engine' => 'V8',
'color' => 'red',
'brand' => 'Chevrolet',
));
echo $car->getColor(); // "red"
class Car
{
private $engine, $color, $brand;
public function __construct($args)
{
hydrate($args);
}
public function getEngine()
{
return $this->engine;
}
public function getColor()
{
return $this->color;
}
public function getBrand()
{
return $this->brand;
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.