array File_HtAccess::getRequire (
)
Get the value(s) of require property as an array. Require property contains the usernames or groups users who are allowed to access protected resources. Value valid-user means all users listed in password file are allowed to access.
string $type
- if 'string' return value
will be a string with usernames separated by a space character.
Otherwise return value will be an array(). Defaults to an array.
mixed string or array depending on $type parameter.
This function can not be called statically.
Using File_HtAccess::getrequire()
<?php
require_once('File/HtAccess.php');
/* add user tuupola and viemero to list of users to be granted access */
$fh = new File_HtAccess('.htaccess');
$fh->addRequire('tuupola');
$fh->addRequire('viemero');
$require1 = $fh->getRequire();
$require2 = $fh->getRequire('string');
print_r($require1);
/* Array */
/* ( */
/* [0] => tuupola */
/* [1] => viemero */
/* ) */
print_r($require2);
/* tuupola viemero */
?>