Codice PHP:
class Dir
{
var $name;
var $location;
//
// Constructor
//
function __construct($name, $location)
{
$this->name = $name;
$this->location = $location;
}
function getName()
{
return $this->name;
}
function getNameHtml()
{
return htmlspecialchars($this->name);
}
function getNameEncoded()
{
return rawurlencode($this->name);
}
//
// Debugging output
//
function debug()
{
print("Dir name (htmlspecialchars): " . $this->getName() . "\n");
print("Dir location: " . $this->location->getDir(true, false, false, 0) . "\n");
}
}