Php - URL

Card Puncher Data Processing

About

Web - URL in php

Parse

The query part

URL - Query String in php

You parse it in two steps:

$parsedQuery = parse_url($url,PHP_URL_QUERY);
  • then you put the key/argument of the query in an array with parse_str. This function takes care of the fact that string may be URL encoded
$parsedQueryArray = [];
parse_str($parsedQuery,$parsedQueryArray);
  • then get the property value
$propertyValue = $parsedQueryArray['propertyName']







Share this page:
Follow us:
Task Runner