Skip to main content
Web Publishing at URI Banner

Web Publishing at URI

Web Publishing at URI » Validate Email


Validate Email

June 5th, 2009 by admin

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.

 

List files in a directory

April 22nd, 2008

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.


Leave a Reply

You must be logged in to post a comment.