Description
This function will analyze the integrity of an email address.
The function will analyze a given email address string and decide whether the address is valid or not. If it is, it will return a boolean output “true.” If not, it will return a boolean output of “false.” The script may use the resulting output to perform actions based on the given input.
Instructions
Code
Insert the following function on the web page
Usage
To call the function, you can apply a “string” element in the argument.
Filed under: Code Library, PHP | Comment (0)
List files in a directory
Description
Generates a list of files and folders in a directory.
Instruction
Code
Insert the following:
[php]
function listDirectory($location) {
$directory = dir(“$location”);
$output = “”;
while($item = $directory -> read())
{
$output = $output . $item . “<br />”;
}
return $output;
}
?>
Usage
The function may be used to produce a list of files and directories within the given directory name. To simply print out the list, use the following:
< ?php print listDirectory("/path/to/directory/"); ?>
Replace /path/to/directory/ with the location you would like to display.