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
소개
Table of Contents
PHP란?
PHP(정식 명칭 "PHP: Hypertext Preprocessor")는 범용성을 지닌 널리 사용되는 오픈 소스 스크립트 언어입니다. 특히, 웹 개발 및 HTML에 포함하기에 적합합니다.
간단한 답이지만, 무엇을 의미할까요? 다음 예제를 봅시다:
Example#1 소개용 예제
<html>
<head>
<title>예제</title>
</head>
<body>
<?php
echo "안녕, 나는 PHP 스크립트야!";
?>
</body>
</html>
Perl이나 C와 같은 다른 언어로 쓰여진 스크립트와 다른점을 알아봅시다 -- HTML을 출력하기 위해서 많은 프로그램 명령어를 쓰는 대신, 무언가를 하기 위해 몇가지 추가 코드가 포함된 HTML 스크립트를 작성하면 됩니다. (여기서는, 약간의 텍스트를 출력합니다) PHP코드는 "PHP 모드"로 들어가고 나올 수 있는 특별한 시작과 끝 태그에 포함되어 있습니다.
PHP가 클라이언트측 자바스크립트 등과 구별되는 점은 이 코드는 서버에서 실행된다는 점입니다. 위와 같은 스크립트가 서버에서 실행되면, 클라이언트는 스크립트의 결과만을 받을 뿐이며, 그 코드가 어떤 모습인지는 알 수가 없습니다. 심지어 모든 HTML 파일을 PHP로 실행되도록 웹 서버를 설정할 수 있으며, 그러면 유저들은 당신이 무슨 일을 하는지 전혀 알 수가 없습니다.
PHP를 사용하는 가장 큰 이득은 초보에게는 매우 쉽고, 전문가에게는 많은 고급 기능을 제공한다는 점입니다. PHP 기능의 긴 리스트를 읽는 것을 두려워하지 마십시오. 그저 시작해 보면 짧은 시간 안에 간단한 스크립트를 작성할 수 있을 것입니다.
PHP의 개발은 서버측 스크립팅에 초점이 맞추어져 있지만, 그보다 더 많은 것들을 할 수 있습니다. PHP로 할 수 있는 것들 섹션을 참고하거나, 웹 프로그래밍에만 관심이 있다면 간단한 튜토리얼로 넘어가십시오.
소개
30-Jan-2008 04:06
18-Aug-2007 07: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~
18-Jul-2007 05: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>!
