djdj - HTMLify profile
files of /djdj/php/Programs/
<?PhP
// php is case insensitive programming lang.
//with three variable
$a = 10;
$b = 5;
$c = $a + $b;
EcHo ($
// php is case insensitive programming lang.
//with three variable
$a = 10;
$b = 5;
$c = $a + $b;
EcHo ($
<?php
//Numeric Array or Index Array
$arr = array('ram','shiv','kumar','arjun');
echo $arr[0];
echo $arr[1];
//Numeric Array or Index Array
$arr = array('ram','shiv','kumar','arjun');
echo $arr[0];
echo $arr[1];
<?php
$add = false;
$update = false;
$delete = false;
// Connecting to the Db
$servername = "localhost";
$add = false;
$update = false;
$delete = false;
// Connecting to the Db
$servername = "localhost";
<?php
$name = "Dj"; //String
$salary = 5000000; //Interger
$experience = 1.5; //Float
$bonus = "50.25k";//Decim
$name = "Dj"; //String
$salary = 5000000; //Interger
$experience = 1.5; //Float
$bonus = "50.25k";//Decim
<?php
//dates in php
echo date("d"). "\n"; //Print date of today : 24
echo date("j"). "\n"; //Print dat
//dates in php
echo date("d"). "\n"; //Print date of today : 24
echo date("j"). "\n"; //Print dat
<?php
// Connecting to the Db
$servername = "localhost";
$username = "root";
$password = "";
$database = "f
// Connecting to the Db
$servername = "localhost";
$username = "root";
$password = "";
$database = "f
<?php
// Connecting to the Db
$servername = "localhost";
$username = "root";
$password = "";
$database = "f
// Connecting to the Db
$servername = "localhost";
$username = "root";
$password = "";
$database = "f
<?php
//for read the file
readfile('yoursfile.txt'); //for only read the file
echo readfile('yoursfil
//for read the file
readfile('yoursfile.txt'); //for only read the file
echo readfile('yoursfil
<?php
//for loop
for ($i=0; $i <= 10; $i++) {
echo $i;
}
?>
//for loop
for ($i=0; $i <= 10; $i++) {
echo $i;
}
?>
<?php
// foreach loop in php
$arr = array('Apple','Banana','Grapes','Mango');
//this is a simply a for loop that us
// foreach loop in php
$arr = array('Apple','Banana','Grapes','Mango');
//this is a simply a for loop that us
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" c
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" c
<?php
//Function in php
$ram = [90, 88, 85, 95, 91];
$sum = marks($ram); // function call
$ave = avera($ram);//
//Function in php
$ram = [90, 88, 85, 95, 91];
$sum = marks($ram); // function call
$ave = avera($ram);//
<?php
if($_SERVER['REQUEST_METHOD'] == 'GET'){//if (isset($_GET)){
$name = $_GET['name'];
$email = $_GET['em
if($_SERVER['REQUEST_METHOD'] == 'GET'){//if (isset($_GET)){
$name = $_GET['name'];
$email = $_GET['em
<?php
echo "Hello World!";
?>
<!--
For embedding/use PHP we have to use <?php ?>
all the php code will goes within the <?php
echo "Hello World!";
?>
<!--
For embedding/use PHP we have to use <?php ?>
all the php code will goes within the <?php
<?php
$a = 5;
$b = 2000;
$c = 2016;
if($a > 2){
echo "a is greater than 2\n";
}
$a = 5;
$b = 2000;
$c = 2016;
if($a > 2){
echo "a is greater than 2\n";
}
<?php
//for connection to database
$servername = "localhost";
$username = "root";
$password = "";
$database
//for connection to database
$servername = "localhost";
$username = "root";
$password = "";
$database
<?php
//Multi Dieminsion Array
$md = array(
array(2,5,7,8),
array(1,2,3,1),
array(5,6,7,2));
//Multi Dieminsion Array
$md = array(
array(2,5,7,8),
array(1,2,3,1),
array(5,6,7,2));
<?php
//Database Connection
/*There are two ways to connect to My SQL Database
1. MySQLi extension (for use only m
//Database Connection
/*There are two ways to connect to My SQL Database
1. MySQLi extension (for use only m
<?php
//for connection to database
$servername = "localhost";
$username = "root";
$password = "";
$database
//for connection to database
$servername = "localhost";
$username = "root";
$password = "";
$database
<?php
//for connection to database
$servername = "localhost";
$username = "root";
$password = "";
//create
//for connection to database
$servername = "localhost";
$username = "root";
$password = "";
//create
<?php
/*Operators
1. Arithmetic Operator
2. Assignment Operator
3. Comparison Operator
4. Logical Operator
*/
$a = 10;
/*Operators
1. Arithmetic Operator
2. Assignment Operator
3. Comparison Operator
4. Logical Operator
*/
$a = 10;
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST'){//if (isset($_POST)){
$name = $_POST['name'];
$email = $_POST
if($_SERVER['REQUEST_METHOD'] == 'POST'){//if (isset($_POST)){
$name = $_POST['name'];
$email = $_POST
<?php
echo"Include:<br>";
//include
include 'MySQL-Databases-Connection.php'; //include will only produce a warning
echo"Include:<br>";
//include
include 'MySQL-Databases-Connection.php'; //include will only produce a warning
<?php
$a = 50; // Global Variable
function paste(){
$a = 10; // Local Variable
echo $a. "\n";
g
$a = 50; // Global Variable
function paste(){
$a = 10; // Local Variable
echo $a. "\n";
g
<?php
$name = 'SabkaCode';
echo $name; //simple print name
echo "\n";
echo "The length of string ".strlen($name
$name = 'SabkaCode';
echo $name; //simple print name
echo "\n";
echo "The length of string ".strlen($name
<?php
$age = 30;
switch($age){
case 18:
echo "You are eligible for vote\n";
break;
$age = 30;
switch($age){
case 18:
echo "You are eligible for vote\n";
break;
<?php
// Connecting to the Db
$servername = "localhost";
$username = "root";
$password = "";
$database = "f
// Connecting to the Db
$servername = "localhost";
$username = "root";
$password = "";
$database = "f
<?php
$name = "Dj";
echo "This is $name";
/*
1. start with a $ sign.
2. cannot satrt with a number.
3. must start with
$name = "Dj";
echo "This is $name";
/*
1. start with a $ sign.
2. cannot satrt with a number.
3. must start with
<?php
//while loop
$i = 1;
while($i<=10){
echo $i. "\n";
$i++;
}
?>
//while loop
$i = 1;
while($i<=10){
echo $i. "\n";
$i++;
}
?>
<?php
//do while loop
$a = 0;
do {
echo $a;
$a++;
} while ($a <= 10);
?>
//do while loop
$a = 0;
do {
echo $a;
$a++;
} while ($a <= 10);
?>