home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam    




, [



Given a URI as the first parameter, returns the equivalent URI with certain characters replaced with % followed by two hexadecimal digits. The first parameter can be a text string, like "http://www.oreilly.com", or an object of type URI::URL. When invoked without a second parameter, uri_escape escapes characters specified by RFC 1738. Otherwise, you can pass in a regular expression (in the context of [ ] ) of characters to escape as the second parameter. For example:

$escaped_uri = uri_escape($uri, 'aeiou')
This code escapes all lowercase vowels in $uri and returns the escaped version.