1. Go to this page and download the library: Download phpvv/array-reflect 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/ */
phpvv / array-reflect example snippets
use VV\Net\Http\Request;
use VV\Net\Http\Response;
use App\Web\BadRequestException;
class Server implements \VV\Net\Http\Server {
public function processHttpRequest(Request $request): Response {
// ArrayReflect::cast($_POST)
$request->post()->setGetterTypeExceptionClass(BadRequestException::class);
try {
return $this->route($request); // /foo/bar
} catch (BadRequestException $e) {
return (new Response)->badRequest($e->getMessage());
}
}
.
.
.
}