Need to parse ini file to extract values

I have a .ini file with contents of...\[code\][template]color1 = 000000color2 = ff6100color3 = ff6100color4 = 000000\[/code\]And a file with contents below which is called from functions.php which passes in 2 values:$myTheme, which is the name of the theme/template whose colors are being sought and $spot, which is the specific color number being sought (colors 1-4)\[code\]$myTheme = $_REQUEST['theme'];$spot = $_REQUEST['spot'];$myColor = get_option($myTheme); $path_to_ini = "styles/". $myTheme . "/template.ini";if ($myColor == "") { if($spot == 1){$myColor = [insert color1 value here];} if($spot == 2){$myColor = [insert color2 value here];} if($spot == 3){$myColor = [insert color3 value here];} if($spot == 4){$myColor = [insert color4 value here];}}echo $myColor;\[/code\]I'm looking for help with how to parse the ini file to fill in the bracketed data with the appropriate color from the template.ini file.
 
Back
Top