Quick notes on PHP – Let’s learn

/*
<head>Beta Code</head>
<body>
<?php
echo “Hello, world!”;
?>
</body>
</html>

So, when the PHP engine first starts processing the page, it assumes it’s dealing with plain old HTML until told otherwise. By using the PHP delimiter, <!–?php, you’re telling the PHP engine to treat anything following the

echo ();
print ();
The two of them do the same job by printing the string between brackets, and you can return (True) value by print ()
// This is a comment
# This is a comment
/*
This is 
a block 
comment
*/
You can make your code more understandable!
$vAriAble
$_variable
$V4ri4ble
$_214
Possible forms of declaring variables
<?php

$y=5; // global scope

function majorTypes()
{
echo $y; // local scope
}
majorTypes();

function staticType()
{
static $x=0; // static scope
echo $x;
$x++;
}
staticType();
staticType();
staticType();
function parType($x)
{
echo $x;
}
parType(5); // parameter scope

?>
Variables Scopes scalar DT
compound DT
special DT
You should know data-types before beginning in coding,,
$test_var; // Declares the $test_var variable without initializing it
echo gettype( $test_var ) . “<br />”; // Displays “NULL”
$test_var = 15;
echo gettype( $test_var ) . “<br />”; // Displays “integer”
$test_var = 8.23;
echo gettype( $test_var ) . “<br />”; // Displays “double”
$test_var = “Hello, world!”;
echo gettype( $test_var ) . “<br />”; // Displays “string”
gettype ($variable) >> function that can examine the variable and retrieve its type
TODO –> Google [is_DataTypes (VALUE) Func. && settype ($variable, "DataType") Fuc.]
HINT: Testing and Changing data_types of variables
See Ya reading the next post Tomorrow
Brief
<?php
$X = 76;
echo “Your progress today with this post is $X pages of the book;
// Read these posts with me DAILY and we will finish this book together :D
?>
About these ads

2 Comments

Filed under PHP

2 Responses to Quick notes on PHP – Let’s learn

  1. Pingback: Quick notes on PHP – barely detailed | Muhammed Refaai

  2. Pingback: Quick notes on PHP – Making A Decision | Muhammed Refaai

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s