Actions

JURI/delVar

From Joomla! Documentation

Revision as of 11:32, 9 August 2012 by JoomlaWikiBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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