JURI/parse
From Joomla! Documentation
< JURI(Difference between revisions)
(New page: Parses the given URI into the internal object properties. Will return '''false''' if a parser error occurred. ===Syntax=== boolean parse( $uri ) where: {| class="wikitable" !Argument !Da...) |
m (→See also: re-categorisation) |
||
| Line 31: | Line 31: | ||
===See also=== | ===See also=== | ||
* [http://api.joomla.org/Joomla-Framework/Environment/JURI.html#parse JURI->parse on api.joomla.org] | * [http://api.joomla.org/Joomla-Framework/Environment/JURI.html#parse JURI->parse on api.joomla.org] | ||
| − | <noinclude> | + | <noinclude>[[Category:JURI]]</noinclude> |
Latest revision as of 11:35, 9 August 2012
Parses the given URI into the internal object properties. Will return false if a parser error occurred.
[edit] Syntax
boolean parse( $uri )
where:
| Argument | Data type | Description | Default |
|---|---|---|---|
| $uri | string | URI to be represented by the JURI object. |
[edit] Example
In this example, a URI object is created and is then re-used for a new URI.
$uri = 'http://fredbloggs:itsasecret@www.example.com:8080/path/to/Joomla/index.php?task=view&id=32#anchorthis'; $u =& JURI::getInstance( $uri ); echo 'URI is ' . $u->toString() . "\n"; $u->parse( 'https://www.example.com/joomla/index.php' ); echo 'URI is ' . $u->toString() . "\n";
would output
URI is http://fredbloggs:itsasecret@www.example.com:8080/path/to/Joomla/index.php?task=view&id=32#anchorthis URI is https://www.example.com/joomla/index.php?task=view&id=32
Note that the query part is not cleared (as can be seen in this example).