You are here: Re: Parsing .htaccess file « PHP Programming Language « IT news, forums, messages
Re: Parsing .htaccess file

Posted by Stefan Bellon on 02/10/06 22:37

Erwin Moller wrote:

> $myLines = file('path/to/.htaccess');
> foreach($myLines as $oneLine){
> echo htmlentities($oneLine)."<br>";
> }
>
> Does that show correctly?

This does print the content correctly, yes, thanks a lot. However, if I
want to parse (and replace) the content using ereg_replace I get funny
results as the bracket < seems to be represented as &lt; internally.
So, when trying to get at the filename, I need to do something like

ereg_replace("&lt;Files (.*)&gt;", "\\1", htmlentities($line))

Wow. Is this the easiest way of filtering out the information? All I
want to do is build a list of "who may access which file according to
the information inside the .htaccess file".

--
Stefan Bellon

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация