PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Ce poate face PHP?> <Pentru început
Last updated: Fri, 27 Jun 2008

view this page in

Introducere

Cuprins

Ce este PHP?

PHP (acronim recursiv pentru "PHP: Hypertext Preprocessor") este un limbaj de scripting de uz general, cu cod-sursă deschis (open source), utilizat pe scară largă, şi care este potrivit în special pentru dezvoltarea aplicaţiilor web şi poate fi integrat în HTML.

Frumos, dar totuşi ce înseamnă aceasta? Un exemplu:

Example #1 Un exemplu introductiv

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>Exemplu</title>
    </head>
    <body>

        <?php 
        
echo "Salut, sunt un script PHP!"
        
?>

    </body>
</html>

În locul unei mulţimi de comenzi pentru a afişa HTML (cum este cazul în C sau Perl), paginile PHP conţin HTML cu cod-sursă încorporat, care realizează "ceva" (în acest caz, afişează "Salut, sunt un script PHP!"). Codul-sursă PHP este încorporat între nişte instrucţiuni de procesare de început şi de sfârşit speciale <?php şi ?>, care vă permit să intraţi şi să ieşiţi din "modul PHP".

Ceea ce face PHP să difere de un JavaScript de partea clientului este că codul său este executat pe server, generând HTML care este apoi trimis către client. Clientul va primi rezultatele rulării acelui script, fără a putea cunoaşte codul-sursă ce stă la bază. Dumneavoastră chiar puteţi să configuraţi web server-ul să proceseze toate fişierele HTML cu PHP, şi atunci într-adevăr nu va fi nici o modalitate ca utilizatorii să afle ce aveţi ascuns în mânecă.

Cel mai bun lucru la PHP este simplitatea extremă pentru un începător, dar totodată existenţa multor facilităţi avansate pentru un programator profesionist. Să nu vă fie teamă să citiţi lista lungă a facilităţilor PHP. Puteţi să vă implicaţi în scurt timp şi să începeţi a scrie scripturi simple peste câteva ore.

Cu toate că dezvoltarea PHP e axată pe scripting de partea server-ului, puteţi să realizaţi mult mai multe cu el. Citiţi în continuare şi aflaţi mai multe detalii în secţiunea întitulată Ce poate face PHP?, sau treceţi direct la ghidul de utilizare introductiv dacă sunteţi interesat doar de programarea web.



Ce poate face PHP?> <Pentru început
Last updated: Fri, 27 Jun 2008
 
add a note add a note User Contributed Notes
Introducere
jordan at nerdsince1984 dot com
01-May-2008 05:01
I agree with Tom. The sentence needs a period. It would be okay to end it with the exclamation point within quotes if the entire sentence was in parentheses. But since it is not, a period needs to come after the closing parenthesis.
Thomas Anderson
17-Apr-2008 07:25
This sentence should be ended with a period:

Instead of lots of commands to output HTML (as seen in C or Perl), PHP pages contain HTML with embedded code that does "something" (in this case, output "Hi, I'm a PHP script!")
nostamar $AT$ g mail
30-Jan-2008 08:06
here is a "server-php >> html >> browser" process illustration:
http://www.lastown.com/forum/viewtopic.php?t=533

it shows the basic steps; first php code is parsed at server into html; then sent to browser, that understands html tags and renders them to the display the webpage, there's also some quick overview about the process.. worths taking a look at
winks716
19-Aug-2007 10:48
before html runs to show a webpage, php code runs first on web server.

so, when there lines as follow:

<table>
<tr>
<td>
  <?php
   
echo "php runs first!";
 
?>
</td>
</tr>
</table>

the first step is to run php code, we get:

<table>
<tr>
<td>
php runs first
</td>
</tr>
</table>

then, code is sent to browser, and we see somthing~
george dot langley at shaw dot ca
19-Jul-2007 08:02
"the code is executed on the server"

This is an important concept for the first-time PHP programmer to understand, so that when you get into string formatting later on, you understand the difference between formatting the on-screen content (as parsed by your browser) and formatting the HTML code (as returned by the server).
For example "/n" starts a new line in the HTML code, and its results are only seen if you look at the "source HTML". It is NOT the same as <br>!

Ce poate face PHP?> <Pentru început
Last updated: Fri, 27 Jun 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites