OK, here's my question: I'm redesigning my webpage in PHP, but I've got a problem. The way I have my pages set up is I have a directory filled with pages for that "section". The list of stuff for that section is filled out with a directory listing (and maybe this would work better with a mysql setup, but then I'd have to get into authentication and stuff too), but anyway.
My question is how can I parse a string line by line. What I'd like to do (and mind you this is largely psuedo-code) is this:
Code:
<?
dirs = exec_shell('ls '.escapeshellarg($_GET['section']))
while (not end of string) do
{
trim 2 chars off end of dirs[currentline];
echo "<a src=view-text.php?section=foo&page=dirs[currentline]>bar";
currentline++;
}
Now I'm not saying that the string(s) has to be an array of lines, that's just one option. If I can substring for the contents between newlines "\n", that would work too. I just need options is all.
Once again, if someone could point me to a good tut on creating forms and stuff so I could use my mysql server and a content-mangment system of my own creation, that would be even greater.... yeah.
but anyway, thanks in advance.