Read a config file into an array I just wanted to know if this looks like a good way of reading a config file. Is this code good? Is it clean and easy to follow?

&lt;?
    /* class to parse a txt config file
     *
     * Boolean like string values (on/off, yes/no, true/false) will return true/false
     * Numberic string values will return real numeric values
     *
     * Ingore error on input.
     *
     * useage: $cp = new config_parse();
     *         $config_parse-&gt;parse_file($input_file);
     *
     * $input_file - the file to be parsed. If a full path is not specified, will assume the file is in the same path as the script calling this class.
     * returns an array of config values in their correct type or false if an error is encountered.
     *
     */

    class config_parse {

        var $config_array;
        var $config_file;
        var $comment_marker = "#";
        var $bool_true_array = array("on", "yes", "true");
        var $bool_false_array = array("off", "no", "false");

        function config_parse() {

            $this-&gt;config_array = array();
            $this-&gt;config_file = "";

        }

        // parse the config file into the config array
        public function parse_file($input_file) {

            if ($input_file=="") {
                return false;
            }

            // locate the config file
            if (file_exists($input_file)) {
                $this-&gt;config_file = $input_file;
            } elseif (file_exists(dirname(__FILE__) . $input_file)) {
                $this-&gt;config_file = dirname(__FILE__) . $input_file;
            } else {
                return false;
            }

            $this-&gt;do_parse();
            return $this-&gt;config_array;

        }

        // read the lines of the file
        private function do_parse() {
            $handle = fopen($this-&gt;config_file, "r");
            if ($handle) {
                while (($line = fgets($handle)) !== false) {
                    $this-&gt;process_config_line($line);
                }
                fclose($handle);
            } else {
                return false;
            } 
        }

        // remove blank lines and comments
        private function process_config_line($line) {
            $line = trim($line);

            // blank
            if ($line=="") {
                return;

            // comment
            } elseif (substr($line,0,1)==$this-&gt;comment_marker) {
                return;

            // actual value
            } else {
                $this-&gt;process_name_value($line);
            }
        }

        // process a line with an actual name/value pair in it.
        private function process_name_value($line) {

            $line_split = explode("=",$line);
            $name = trim($line_split[0]);
            $value = trim($line_split[1]);

            $this-&gt;config_array[$name]=$this-&gt;process_value($value);
        }

        private function process_value($value) {

            if (in_array($value,$this-&gt;bool_true_array)) return true;
            if (in_array($value,$this-&gt;bool_false_array)) return false;
            if (is_numeric($value)) return $value+0;
            return $value;

        }
    }
    ?&gt;
This code looks pretty good, but you seem to have largely reinvented parse_ini_file($filename, false, INI_SCANNER_TYPED).  All you need to add is the support for the search path.

do_parse() is inconsistent about returning a status code, and parse_file() fails to check it.

You should call explode("=", $line, 2), so that any = character in the value will be interpreted literally.