They'll both be equally easy and difficult to learn. As of PHP 4 (I haven't used 5 yet); you'll find JavaScript is a much better implemented and thus much more intuitive language.
They both do different things though.
For 'live' events on a page (things that change the HTML document without reloading it for example) PHP isn't going to work atall. You'll need to use JavaScript.
If you want to prepare the page on your server before the user gets into it, JavaScript isn't going to work (unless you use ASP, but then you're really using ASP rather than JavaScript). PHP is suitable for this kind of thing.
If you want to do both at the same time, you'll need to use some handy Javascript objects that let you communicate back to your webserver.
Yes, you can use text files to replace databases. PHP is more optimized to work with databases, but you'll find that you can use a variety of methods to store and retrieve data.
You can't store and retrieve data in JS alone, but you can create scripts on the server to do tasks like that, and then call them form JS using those 'handy objects' I mentioned.
Moderator
Featured Poster
Reputation Points: 522
Solved Threads: 64
Veteran Poster
Offline 1,091 posts
since Jul 2006