Forum Moderators: coopster
one text file wiht the article itself formatted using html
one file containing the title and description of all articles in folder
one file containing the latest addition, regardless of which folder (section) they went into. also title and description. this will be included onto the front page of the site.
adding article is straight forward, btu when it comes to editing things get a bit tricky. i can retirve the info from the article file, but how do i get it fomr the two files with the article descriptions? the thing is these two files will be updated all the time and there is no way of knowing where in the file they are. so im thinking some sort of search adn delete or search and replace function...any ideas appreciated.
kumar
This means that each document, searchable information and viewable information, will be stored in a single coherent record, and can be updated simultaneously without much trouble. Plus it gives you a layer of abstraction between your HTML and your data, which is a really good practice -- especially if you ever want to format your information differently.
When it comes to searching, str_replace would be a lot faster than preg_replace. It's also a whole lot easier to learn how to use. Use it when you can.
preg_replace compared to str_replace is sort of like the difference between using a database and using files. It's so much more powerful. But there's a learning curve for this one, and it also isn't quite as fast and processor-friendly as str_replace.
The ereg stuff are a bit 'old' and they're not as fast as the preg variant functions - skip ereg, learn preg instead.