Read line comments in INI file

Posted by Dave Jarvis on Stack Overflow See other posts from Stack Overflow or by Dave Jarvis
Published on 2010-04-17T01:41:14Z Indexed on 2010/04/17 1:43 UTC
Read the original article Hit count: 365

Filed under:
|
|
|

The parse_ini_file function removes comments in configuration files.

What would you do to keep the comments that are associated with the next line?

For example:

[email]
; Verify that the email's domain has a mail exchange (MX) record.
validate_domain = true

Am thinking of using X(HT)ML and XSLT to transform the content into an INI file (so that the documentation and options can be single sourced). For example:

<h1>email</h1>
<p>Verify that the email's domain has a mail exchange (MX) record.</p>
<dl>
<dt>validate_domain</dt>
<dd>true</dd>
</dl>

Any other ideas?

© Stack Overflow or respective owner

Related posts about php

Related posts about documentation