
What is PHP?
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.
What can PHP do?
PHP is mainly focused on server-side scripting, so you can do anything any other CGI program can do, such as collect form data, generate dynamic page content, or send and receive cookies. But PHP can do much more.
There are three main areas where PHP scripts are used.
- Server-side scripting. This is the most traditional and main target field for PHP. You need three things to make this work: the PHP parser (CGI or server module), a web server and a web browser. You need to run the web server, with a connected PHP installation. You can access the PHP program output with a web browser, viewing the PHP page through the server. All these can run on your home machine if you are just experimenting with PHP programming.
- Command line scripting. You can make a PHP script to run it without any server or browser. You only need the PHP parser to use it this way. This type of usage is ideal for scripts regularly executed using cron (on *nix or Linux) or Task Scheduler (on Windows). These scripts can also be used for simple text processing tasks.
- Writing desktop applications. PHP is probably not the very best language to create a desktop application with a graphical user interface, but if you know PHP very well, and would like to use some advanced PHP features in your client-side applications you can also use PHP-GTK to write such programs. You also have the ability to write cross-platform applications this way. PHP-GTK is an extension to PHP, not available in the main distribution.

PHP คืออะไร
PHP เป็นภาษาสคริปต์แบบ open source ที่มีการใช้กันแพร่หลาย และมีความเหมาะสมสำหรับการพัฒนาเว็บและสามารถฝังลงใน HTML ได้
PHP สามารถใช้ทำอะไรได้
PHP มุ่งเน้นหลักในการเขียนสคริปต์ฝั่ง server ดังนั้นคุณจึงสามารถทำอะไรก็ได้ที่โปรแกรม CGI อื่น ๆ สามารถทำได้ เช่นสามารถเก็บข้อมูลจากฟอร์ม สร้างเนื้อหาของหน้าเว็บแบบไดนามิก หรือส่งและรับ cookies แต่ PHP สามารถทำได้มากกว่านี้
มี 3 ส่วนหลักๆ ที่ PHP script ถูกใช้งานบ่อยๆ
- การเขียนสคริปต์ฝั่งเซิร์ฟเวอร์ เป็นเป้าหมายหลักของการใช้ PHP มาตั้งแต่แรก ต้องมี 3 สิ่งก่อนที่จะทำการเขียนสคริปต์ได้ คือ PHP parser (CGI or server module), web server และ web browser จำเป็นต้องเรียกใช้เว็บเซิร์ฟเวอร์ที่มีการติดตั้ง PHP ด้วย และสามารถเข้าถึงผลลัพธ์ของโปรแกรม PHP ด้วยเว็บเบราเซอร์
- Command line scripting สามารถสร้างสคริปต์ PHP เพื่อเรียกใช้งานได้โดยไม่ต้องใช้เซิร์ฟเวอร์หรือเบราเซอร์ ชนิดของการใช้งานนี้เหมาะสำหรับสคริปต์ที่รันอย่างสม่ำเสมอโดยใช้ cron (on * nix หรือ Linux) หรือ Task Scheduler (บน Windows) สคริปต์เหล่านี้สามารถใช้สำหรับงานประมวลผลข้อความธรรมดา
- Writing desktop applications. PHP อาจไม่ใช่ภาษาที่ดีที่สุดในการสร้างแอ็พพลิเคชันที่มี user interface ที่สวยงาม แต่ถ้ารู้จัก PHP ดี และต้องการใช้คุณลักษณะขั้นสูงของ PHP ในแอ็พพลิเคชันฝั่งไคลเอ็นต์ ยังสามารถใช้ PHP-GTK เพื่อเขียนโปรแกรมดังกล่าว นอกจากนี้ยังมีความสามารถในการเขียนโปรแกรมข้ามแพลตฟอร์มด้วยวิธีนี้ PHP-GTK เป็นส่วนขยายของ PHP
