hi wade i think u should try this. i did few changes in it. just removed to many "'" single quotes and i hope it will help u. below is the code: foreach ($_POST as $nkey => $new){ foreach($olddata as $okey => $old) { if ($new == $old) { print $new." AND ".$old." are the <b style='color:red'>SAME</b>; Next... <br />"; } else { print $new." AND ".$old." are the <b>DIFFERENT</b>; Next... <br />"; } } } have a good time bye babal
--- In php-list@yahoogroups.com, Wade Smart <[EMAIL PROTECTED]> wrote: > > 07022006 1530 GMT-6 > > I am wanting to compare two things: the information from the $_POST and > my existing data in $olddata -> this is an array obviously. > > I always forget how to use this foreach inside one another. > I want to check $_POST['fname'] against $olddata['fname'] and if they > are the same, for simple testing I want to print out SAME and > if different, DIFFERENT. > > > > foreach ($_POST as $nkey => $new){ > foreach($olddata as $okey => $old) { > if ($new == $old) { > print '"'.$new.'" AND "'.$old.'" are the <b style="color:red">SAME</b>; Next... <br />'; > } else { > print '"'.$new.'" AND "'.$old.'" are the > <b>DIFFERENT</b>; Next... <br />'; > } > } > } > Community email addresses: Post message: php-list@yahoogroups.com Subscribe: [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] List owner: [EMAIL PROTECTED] Shortcut URL to this page: http://groups.yahoo.com/group/php-list Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php-list/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/