[ create a new paste ] login | about

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

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

$string='http://www.example.com/username?refid=22';


$url = parse_url($string);

unset($url['query']);

echo array_shift($url) . '://' . implode($url);


Output:
1
http://www.example.com/username


Create a new paste based on this one


Comments: