![]() |
|
|
|
||||||||||
![]() |
|
|
Thread Tools |
|
#1
|
|||
|
|||
|
how to remove variable and its value from url ?
how to remove a variable and its value which can be any value for example 123456 from this url
http://www.eample.com/test.php?a=123456&b=754&c=2254 |
|
#2
|
|||
|
|||
|
Are you asking how to not have it show in the URL?
Or how to extract it from the URL to use in a script for some purpose. This is quite common. |
|
#3
|
|||
|
|||
|
i want to extraxt it from the url (remove it) and use the rest of the url
|
|
#4
|
||||
|
||||
|
Code:
$url_array = array(); $url_array = parse_url($your_url); print_r($url_array); |
|
#5
|
|||
|
|||
|
Quote:
all what i want to do is remove the unwanted part which is a=123456 |
|
#6
|
||||
|
||||
|
Can you explain how you intend on using the remainder of the url. I think it will help give a more appropriate answer.
If you need to use the url as-is without the value pair, you would want to use parse url, and then reconstruct the url without the undesired variable. This way you are certain to remove the full parameter and value. |
|
#7
|
|||
|
|||
|
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Remove a variable from QUERY_STRING? | digitalunix | ASP | 4 | May 14th 2009 8:27 am |
| Need to pass URL into HTML from URL variable? | Seqqa | PHP | 3 | Jun 19th 2008 2:37 pm |
| How to Remove php variable on redirect? | ascensions | Apache | 1 | Sep 23rd 2006 9:20 pm |
| how do I remove ssi, htm from a string variable | t7584 | ASP | 2 | May 8th 2006 7:44 am |
| how do I remove ssi, htm and a character from a string variable | t7584 | PHP | 1 | May 7th 2006 7:24 am |