How to remove a value from URL parameter? I'm using entity reference prepopulate and views. On the start of my node add form I'm using views to display some products and I have created a PHP button to pass the nid of those products to the URL. Here is the code:

&lt;?php 
$url = token_replace('[current-page:url]'); 
$l = l( t('SELECT THIS VENUE'), $url,  array('query' =&gt; array('field_product_venue' =&gt;$row-&gt;nid )  ));
echo $l; 
?&gt;


And on the last part of my node add form the user can see the summary of all the products he or she has chosen but he or she must also have the ability to remove those items, since the form gets its selected products from the url I want to create a button that deletes that specific product (nid) from the URL.

Any help would be greatly appreciated.
You need to get the value of the parameter, then check if the parameter contains the nid, then replace/remove the nid on your parameter from your url.

Use this code on your Views: PHP

&lt;?php 
$url = token_replace('[current-page:url]');
$venue =$_GET['field_product_venue'];
if (strpos($venue, $row-&gt;nid) !== false) {
$change= str_replace($row-&gt;nid .',', '', $venue);
$l = l( t('DELETE'), $url,  array('query' =&gt; array('field_product_venue'=&gt;$change)  ));
echo $l;    
}
?&gt;