Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php url variables

$url = 'http://username:password@hostname:9090/path?arg=value#anchor';
var_dump(parse_url($url));
/**
array(8) {
  ["scheme"]=>
  string(4) "http"
  ["host"]=>
  string(8) "hostname"
  ["port"]=>
  int(9090)
  ["user"]=>
  string(8) "username"
  ["pass"]=>
  string(8) "password"
  ["path"]=>
  string(5) "/path"
  ["query"]=>
  string(9) "arg=value"
  ["fragment"]=>
  string(6) "anchor"
}
**/
 
PREVIOUS NEXT
Tagged: #php #url #variables
ADD COMMENT
Topic
Name
7+7 =