If have an admin area where users can select a category name and an associated color to match it. There are 10 options (i.e. 10 categories, 10 colors)
This then gets outputted to the header to control category colors:
So for example,
$cat1 = get_option('catname1');
$col1 = get_option('col1');
$cat2 = get_option('catname2');
$col2 = get_option('col2');
and so on until 10. These are then outputted to CSS as follows (if the user has inputted anything on the admin panel):
if($cat1){echo "
.".$cat1"{ color:".$col1." !important; }
.".$cat1." { background-color:".$col1." !important; }" };
How would I combine these statements in a foreach (basically to go from cat1 to cat10)?