Php - URL

Card Puncher Data Processing


Web - URL in php


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 = [];
  • then get the property value
$propertyValue = $parsedQueryArray['propertyName']

Share this page:
Follow us:
Task Runner