I am adding meta tags, titles, stylesheets and scripts to each page via PHP – but all separate from page to page (since i have a header.php that is universal) I am still on the fence though of what is faster for 20+ pages. I could easily store all my values and such in a multidimensional array and return the whole array, then distribute each value accordingly or I can query a database but really which would give me the fastest result? Would it really be that much slower to even matter? Would the user even notice? All questions I have no answers to what do you guys think?
Share
I wouldn’t bring a database into the mix for a couple dozen pages – not unless you’ve got a bunch of content you need to store in there. Rather, what I would do is build the array on each page, then include the template:
Within your
header.phpfile, have the following:This may be suitable for much of what you’re doing, but when things start to get heavier – definitely put more long-term stock in a database solution.