remove a part of a URL argument string in php

JSorrentino

New Member
I have a string in PHP that is a URI with all arguments:\[code\]$string = http://domain.com/php/doc.php?arg1=0&arg2=1&arg3=0\[/code\]I want to completely remove an argument and return the remain string. For example I want to remove \[code\]arg3\[/code\] and end up with:\[code\]$string = http://domain.com/php/doc.php?arg1=0&arg2=1\[/code\]I will always want to remove the same argument (\[code\]arg3\[/code\]), and it may or not be the last argument.Thoughts?EDIT: there might be a bunch of wierd characters in \[code\]arg3\[/code\] so my prefered way to do this (in essence) would be:\[code\]$newstring = remove $_GET["arg3"] from $string;\[/code\]
 
Back
Top