Actions

Difference between revisions of "JURI/delVar"

From Joomla! Documentation

(New page: Removes an individual query item from the query part of the URI represented by the JURI object. ===Syntax=== void delVar( $name ) where: {| class="wikitable" !Argument !Data type !Descrip...)
 
m (See also: re-categorisation)
 
Line 32: Line 32:
 
* [[JURI/setVar|JURI->setVar]]
 
* [[JURI/setVar|JURI->setVar]]
 
* [[JURI/getVar|JURI->getVar]]
 
* [[JURI/getVar|JURI->getVar]]
<noinclude>[[Category:Development]][[Category:Framework]][[Category:JURI]]</noinclude>
+
<noinclude>[[Category:JURI]]</noinclude>

Latest revision as of 11:32, 9 August 2012

Removes an individual query item from the query part of the URI represented by the JURI object.

Syntax

void delVar( $name )

where:

Argument Data type Description Default
$name string Name of the query item to be removed.

Example

In this example, a URI object is created and then one of the query items is removed.

$uri = 'http://fredbloggs:itsasecret@www.example.com:8080/path/to/Joomla/index.php?task=view&id=32#anchorthis';
$u =& JURI::getInstance( $uri );
echo 'Before: ' . $u->toString() . "\n";
$u->delVar( 'task' );
echo 'After : ' . $u->toString();

would output

Before: http://fredbloggs:itsasecret@www.example.com:8080/path/to/Joomla/index.php?task=view&id=32#anchorthis
After : http://fredbloggs:itsasecret@www.example.com:8080/path/to/Joomla/index.php?id=32#anchorthis

See also