You are here

private static function Redirects::extractUrlParameters in Hook Update Deploy Tools 8

Same name and namespace in other branches
  1. 7 src/Redirects.php \HookUpdateDeployTools\Redirects::extractUrlParameters()

Breaks url query string into an array.

Parameters

string $parameters_string: A text string consisting of everything to the right of the ? in the url.

Return value

array Array of params in param => value pairs.

1 call to Redirects::extractUrlParameters()
Redirects::parseList in src/Redirects.php
Create redirects from a list of redirects.

File

src/Redirects.php, line 438

Class

Redirects
Public methods for importing redirects.

Namespace

HookUpdateDeployTools

Code

private static function extractUrlParameters($parameters_string) {
  $params_array = array();
  if (!empty($parameters_string)) {

    // Means there is something to process.
    $param_elements = explode('&', $parameters_string);
    foreach ($param_elements as $param_element) {
      $param = explode('=', $param_element);
      $params_array['query'][$param[0]] = $param[1];
    }
  }
  return $params_array;
}