ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
as far as i know the backticks operator works without invoking a shell but of course the readfile function could be used as well.
exec, passthru and backticks are functions to invoke/execute other scripts and programs so one has to be careful with dynamically posted commands here.
gives me the text file unformatted, sort of cannot detect end of line, and exec ("/bin/cat myfile.txt", &$output); gives me an array. I am sure i am close to solution here, will try to manipulate the output, or printout the array and see how its going...
The "problem" here (not a real problem, just straightforwardness) is that in bash CRLF translates to a new line on your screen, while in HTML you need a <br> tag to accomplish the same.
The backtick or read method work as well, you only must put some effort in translating CRLF (or just CR in the Linux world, or was it LF?) into <br>. It is the old tradeoff between quick coding and efficient code.