PHP Tutorial - PHP Introduction
๐ PHP Kya Hai?
๐ Real Life Mein:
Restaurant Ka Kitchen:
๐จโ๐ณ HTML = Menu (dikh ta hai)
๐ฅ PHP = Kitchen (peeche ka kaam)
๐ฝ๏ธ Output = Ready food (final page)
PHP = Server pe chalti hai, user ko sirf result dikhta hai!
๐ PHP = Hypertext Preprocessor
- Server-side scripting language
- Dynamic web pages banata hai
- Database se connect karta hai
- Forms process karta hai
- Files handle karta hai
๐ฏ PHP Kahan Use Hota Hai?
| Website | PHP Use |
|---|---|
| User profiles, posts | |
| WordPress | Complete CMS |
| Wikipedia | Content management |
| Yahoo | Backend services |
๐ PHP vs JavaScript
| PHP | JavaScript |
|---|---|
| Server-side | Client-side |
| Before page load | After page load |
| Database access | DOM manipulation |
| Hidden from user | Visible in browser |
PHP Files: .php extension
Opening tag: <?php
Closing tag: ?> (optional at end)
Opening tag: <?php
Closing tag: ?> (optional at end)
Example
<?php
echo "Hello, World!";
?>