MSMazhar Solkarinmazharsolkar.hashnode.dev·Jun 8, 2024 · 3 min readBasic Calculator in PHP<!DOCTYPE html> <html lang="en"> <body> <form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method='post'> <input type="number" name="num01" placeholder="First Number..." required /> <select name="operator"> <option...00
MSMazhar Solkarinmazharsolkar.hashnode.dev·Jun 8, 2024 · 2 min readConditional Statement is PHPif statement <?php $age = 20; if ($age >= 18) { echo "You are an adult."; } if-else statement <?php $age = 16; if ($age >= 18) { echo "You are an adult."; } else { echo "You are a minor."; } Ternary Operator <?php $age = 20; $status =...00
MSMazhar Solkarinmazharsolkar.hashnode.dev·Jun 8, 2024 · 2 min readOperators in PHPArithmetic Operators + - / % **(exponential) <?php $a = 2**3; // 2^3 = 8 ?> Assignment Operators = += -= /= %= Comparison Operators == === != !== > < >= <= Increment/Decrement Operator $a++ $a-- Logical Operators and OR && or OR || xor !(not) XOR -...00
MSMazhar Solkarinmazharsolkar.hashnode.dev·Jun 8, 2024 · 2 min readBasic Form HandlingSetup Create index.php file. Create includes folder inside this create formhandler.php file. index.php <!DOCTYPE html> <html lang="en"> <body> <form action="includes/formhandler.php" method="post"> <label for="firstname">Firstname: </l...00
MSMazhar Solkarinmazharsolkar.hashnode.dev·Jun 8, 2024 · 1 min readPHP Script Tag and DatatypesPHP Script Tag PHP code is written inside PHP script tag. <?php ?> <?php echo "Hello World !"; echo "Mazhar Solkar ?> Note: ?> === semicolon after the last statement inside PHP script tag. semicolon will be automatically added after echo "Mazhar S...00