Join 4,000+ others and never miss out on new tips, tutorials, and more.
Latest version:
pecl install openswoole-22.1.2 | composer require openswoole/core:22.1.5
<?php OpenSwoole\Http\Request->get: array
None
Array
The OpenSwoole\Http\Request->get
class property is an array which contains the information of HTTP GET URL parameters. For example a URL like http://shop.co.uk/tools/hammers?price=high
is where price=high
will be inside the OpenSwoole\Http\Request->get
array.
This array is equivalent to the PHP super global of $_GET
, you should use OpenSwoole\Http\Request->get
instead.
<?php
$server->on('Request', function(OpenSwoole\Server\Request $request, OpenSwoole\Server\Response $response)
{
// Show the selected price filter from the URL
echo $request->get['price'];
// Display all the GET parameters
var_dump($request->get);
});