ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilCtrlQueryRegexParser.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
25{
26 private const PATTERN = '/([^=&]*)=([^=&]*)/m';
27
28 public function parseQueriesOfURL(string $query_string): array
29 {
30 preg_match_all(self::PATTERN, $query_string, $matches, PREG_SET_ORDER, 0);
31 $query_parameters = [];
32 foreach ($matches as $match) {
33 $query_parameters[$match[1]] = $match[2];
34 }
35
36 return $query_parameters;
37 }
38
39}
parseQueriesOfURL(string $query_string)
Must return an associative array of key => value pairs from the given query string.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...