> $invalid = array("1","3","9");
> $questions = array("1","2","3","4","5","6","7","8","9");
>
> $new_questions = array("<font color=red>1</font>",
>                        "2",
>                        "<font color=red>3</font>",
>                        "4","5","6","7","8",
>                        "<font color=red>4</font>");

There's no one-line built-in array_xxx function to do that, AFAIK.  This
isn't Lisp, after all :-)

reset($questions);
while (list($index, $qid) = each($questions)){
    if (in_array($qid, $invalid)){
        $new_questions[$index] = "<font color=red>$qid</font>";
    }
    else{
        $new_questions[$index] = $qid;
    }
}

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to