[ create a new paste ] login | about

Link: http://codepad.org/xxol2P3A    [ raw code | output | fork ]

PHP, pasted on Apr 19:
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php

$string = 'http://example.com/profile.php?id=9999&refid=22';

$url = parse_url($string);

parse_str($url['query'], $get);

unset($get['refid']);

$url['query'] = http_build_query($get);

echo $url['scheme'] . '://' . $url['host'] . $url['path'] . '?' . $url['query'];


Output:
1
http://example.com/profile.php?id=9999


Create a new paste based on this one


Comments: