[thelist] PHP & arrays

Mark Joslyn mark.joslyn at solimarsystems.com
Tue May 7 14:04:07 CDT 2002

Thanks List/Steve,

This worked perfectly - once again theList saves the day!

    // $myEmailP is an array and has already been defined
    $reqNames = array("Jim", "John", "Frank", "Bob");
    $name_is_found = FALSE;

    // foreach opperates on a copy of $reqNames so we don't have to
worry about reseting it
    foreach($reqNames as $name)
        if (in_array($name, $myEmailP))
            $name_is_found = TRUE;
    if (!($name_is_found))
        error("Please enter a valid employee name.");


More information about the thelist mailing list