hehehe yeah never thought about it like that. Yeah print_r() is very useful for displaying what a variable holds - especially arrays and the $_POST variable.
I managed to fix the code and it all works perfectly now. If anyone is interested then the code is:
[PHP]if($ValidData['Required'])
{
foreach(explode(",",$ValidData['Required']) as $field)
{
if(empty($_POST[$field]))
{
$field = str_replace("_"," ",$field);
$field = ucwords($field);
$empty_fields = "<li><b><font color=\"".$Colour['Required']."\">$field </font></b></li>";
if($empty_fields)
print $empty_fields .$ErrorMsg['Required'];
}
}
}[/PHP]
Thanks for all your support guys

JameZ