Well, you can rename your form input fields to not include the PERS_ text. This might be made easier if you use arrays to store your form input data. You can organize all your desserts in an array, all your entrees in a different array, etc.
For more info, read my tip from a while back:
http://p2p.wrox.com/archive/beginnin...2002-08/52.asp
If you'd just like to get your script working as soon as possible, then you can modify your regular expression check to only match the part you want to keep:
if(ereg("^PERS_(.*)$", $lvar, $matches)>0)
{
echo "{$matches[1]}: $lvalue<br>\n";
...
}
$matches is my "regs" parameter. It is an array that stores all the parenthesized matches in the regular expression. $matches[0] is always the entire source string, if there was a match. $matches[1], $matches[2], ... are all the sub-parts of the regular expression that were enclosed in parenthesis.
In your expression, I added the text (.*)$, which means "and every character up till the end of the string.
Because I have the .* in parenthesis (that's the "every character" part), whatever matches THAT part of the expression will be put in it's own index into the $matches array. Since it's the first parenthesized expression, it will be $matches[1].
For more information:
http://www.php.net/ereg
Take care,
Nik
http://www.bigaction.org/