2. INDEX
• Into • Do … while loop
• Syntax • While loop
• Variables • For loop
• String • Functions
• Operators • Form
• If else • $_POST
• Switch • $_GET
• Array • $_REQUEST
3. INTRO • What is PHP?
• What is MySQL?
• Why PHP?
4. PHP SYNTAX • Extension
• First file name
• Where shall we save the project
• <?php ?>
• <html><body>
• <?php echo "Hello World"; ?>
• </body></html>
• Comments in PHP
5. VARIABLES • Creating (Declaring) PHP Variables
• $myName=“Doksh";
• PHP has four different variable scopes:
• local
• global
• static
• parameter
6. LOCAL • <?php
• $a = 5; // global scope
• function myTest()
• {
• echo $a; // local scope
• }
• myTest();
• ?>
10. STRLEN() • <?php
FUNCTION • echo strlen("Hello world!");
& • ?>
STRPOS()
______________________________
FUNCTION
<?php
echo strpos("Hello world!","world");
?>
11. OPERATORS • +
• -
• *
• /
• %
• -m
• M.m
• X=y
• X +=y …. etc
• ++x per
• X++ post
• X == y, X != y
• X === y, X !== y
• X >= y, X >y
• X && y
• X y
12. IF & DATE • <html>
• <body>
• <?php
• $d=date("D");
• if ($d=="Fri")
• {
• echo “WOW";
• }
• elseif ($d=="Sun")
• {
• echo “OK OK OK OK";
• }
• else
• {
• echo “ohhhh!";
• }
• ?>
• </body>
• </html>