Re: Php & Directory structures
| From: | Bogdan Stancescu | Date: | Sat, 22 Dec 2001 15:31:42 +0000 |
| Subject: | Re: Php & Directory structures | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-78570@lists.php.net to get a copy of this message | ||
Just a suggestion: use exec("ls -1 root/articles/??_head.xml",$article_files) to
find out the files -- then walk $article_files, parse the file and echo whatever
you please. :-)
Bogdan
Martin Hughes wrote:
> Heya,
>
> Can PHP count the number of a certain ftile in a directory and then print
> the result to the screen? I have articles on my site that are in XML/XSL
> format like:
>
> root/articles/00_head.xml
> 00_body.xml
> 01_head.xml
> 01_body.xml
> 02_head.xml
> 02_body.xml
> etc... (with appropriate XSL stylesheets too...)
>
> and I want to have a main "article page" with the head.xml info on it:
>
> Article 00:
> By: <author>
> Date: <whatever date>
> Subject: <subject>
>
> and then a link to the article itself (which will be an XSL stylesheet
> loading both the header info and the article body.xml).
>
> Can php count the number of articles etc in the dir and then automatically
> create the page? (or can anyone think of a better way of doing this???? :-))
>
> Cheers,
>
> Martin
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net