1. 장. 소개 (Introduction)

차례
PHP란 무엇인가?
PHP로 무엇을 할 수 있는가?
PHP의 역사

PHP란 무엇인가?

PHP(공식적으로 "PHP: Hypertext Preprocessor ")는 server-side HTML-embedded scripting language입니다.

간단한 답이지만, 무엇을 의미할까? 다음 예를 보자:

예 1-1. 소개용 예문

<html>
    <head>
        <title>Example</title>
    </head>
    <body>
    
        <?php 
        echo "Hi, I'm a PHP script!"; 
        ?>
        
    </body>
</html>

Perl이나 C와 같은 다른 CGI 스크립트와 달리 PHP는 HTML을 출력하는데 많은 명령어가 필요없다. HTML내에 하고자 하는 일(위의 영우 한줄의 문자열 출력)에 대한 스크립트를 적어주면 된다. PHP코드는 특정한 시작과 끝 태그 사이에 들어가게 되는데, 이 태그를 통해 HTML 모드에서 PHP모드로 들어가거나 나오는 것이다.

PHP가 다른 Clien-side Javascrip와 구별되는 것은 이 코드가 서버에서 실행된다는 것이다. If you were to have a script similar to the above on your server, the client would receive the results of running that script, with no way of determining what the underlying code may be. You can even configure your web server to process all your HTML files with PHP, and then there's really no way that users can tell what you have up your sleeve.