Quote (rx7drifter @ Mar 20 2018 12:59am)
php is mainly used for back-end web development. It does server-side data manipulations. It is pretty much only used for generating web pages, but there are ways you can use it for non-web-related things, but it is rarely the best choice.
A very basic use of php would be to handle the inputs from an html form (you may want to start here as a first example). HTML doesn't have variables, so you need to use things like PHP or JavaScript to do anything other than serve a static web page.
I mainly use php to do file manipulations on a web server and to interact with a database to handle data input/output on a web page.
PHP stands for Hypertext Preprocessor, whereas HTML is Hypertext Markup Language. php code is executed before the web page fully loads and generates the HTML dynamically, based on different factors (who you are, location, requested language, etc).
This forum is built using php (notice the .php in every page URL, instead of .html). So basically, things like your username at the top left, how much gold you have, etc, are pulled from d2jsp's database using (maybe SQL, but there are other popular DB query languages) calls using php and stored in variables. These variables are then used in the HTML as it is created.
Yes, java and python can technically do everything php can in terms on serving a webpage. I would recommend using php in the majority of cases, but they can all be used almost equivalently.
Gotchya that makes sense, thanks so much!