The parse_ini_file
function removes comments when reading 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?
You could use preg_match_all to extract comments after
[heading]
markups:foo.ini could contain:
I didn't play around with parse_ini_file because I don't feel like rebooting to another OS with PHP 5.3, but I think it should be easy to generate the rest of the HTML.