Question:
can someone tell me what php is?
blahh
2009-08-05 17:09:06 UTC
what is php exactly? like. what does it do? please explain it clearly. thanks.
Five answers:
gd7
2009-08-05 18:05:19 UTC
It's a "hypertext preprocessor".



To start, it's a program that runs on a server.



If you take an HTML file and put it on a website, then visit the URL of that file, the HTML will be sent to the visitor and displayed by the browser.



With a PHP file, you write a script in the PHP language, and upload it to the server. Assuming that the server has PHP (the program) installed, the sever will open up the script on the SERVER's end, interpret the PHP language that you wrote.



So, the PHP script tells the server what to do. Usually, you would use the PHP to tell the server that you want to output HTML. You could say, print "", and then the server will send "" to the visitor. Then you could tell it to print "", and so on, for the rest of the HTML page.



On the visitor's end, there is no difference between a PHP page and an HTML page. With a PHP page, the web browser still receives a bunch of HTML and displays it. The only difference is that, instead of a pure HTML file that was uploaded and downloaded in the same form, the PHP file was a bunch of HTML that was generated according to the instructions in a PHP script.



What's the advantage to this if you can write HTML without PHP?



The advantage is that you can use PHP to identify certain conditions, and use different HTML for different conditions, in order to make a "dynamic" page.



For example, you could use PHP to determine the time of day. Then you could say, "if" it's in the afternoon, I want to ouput such-and-such HTML. "if" it's in the morning, I want to output different HTML. So on.



A very common use for PHP is to connect to a database. You could tell PHP to get information from a database and display it on the page. That way, any time the database information changes, the PHP page changes.



Another common use is to handle web forms--for example, the web form you used to submit your question about PHP. Once you submit the form, it could be sent to a PHP page. Then the PHP makes sure that you didn't submit an empty form. In conjunction with that, PHP is used to put information into a database, so then the PHP page takes the question you asked and put it into a database.



PHP has many different functions. It can deal with databases (one kind of database is called MySQL, but that's not the only kind), email, file processing, dates, times, time zones, and many other types of data.



PHP is not the only kind of language that provides this type of capability. ASP, Ruby, Python, Java, and C can all be used on websites. But, PHP is very common. It's easy to start learning (but that doesn't mean it's easier to get good at it).



For a very simple introduction to the PHP language, see http://www.w3schools.com/
anonymous
2009-08-06 00:23:45 UTC
PHP is a scripting language originally designed for producing dynamic web pages. It has evolved to include a command line interface capability and can be used in standalone graphical applications.



While PHP was originally created by Rasmus Lerdorf in 1995, the main implementation of PHP is now produced by The PHP Group and serves as the de facto standard for PHP as there is no formal specification. PHP is free software released under the PHP License, which is incompatible with the GNU General Public License (GPL) due to restrictions on the use of the term PHP.



PHP is a widely-used general-purpose scripting language that is especially suited for web development and can be embedded into HTML. It generally runs on a web server, which is configured to take PHP code as input and create web page content as output. It can be deployed on most web servers and on almost every operating system and platform free of charge. PHP is installed on over 20 million websites and 1 million web servers.



Ron
anonymous
2009-08-06 00:16:28 UTC
PHP - programming (scripting) language and program.



It generally runs on a web server, which is configured to take PHP code as input and create web page content as output. It can do all the stuff you can see on internet. Usually create dynamic web page content.
zqert988
2009-08-06 00:11:48 UTC
Scripting language:



http://en.wikipedia.org/wiki/Php
Will
2009-08-06 00:22:44 UTC
It runs on a MySQL database most of the time. It is a web development language (often considered a programming language) that pulls data from a server and puts the information on the webpage.



-Billy


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...