Viewing Category » php-lesson1(variables)

Echo and print are used to output in PHP

Post Thumbnail of Echo and print are used to output in PHP
 php-lesson1(variables)       

these two functions are used to output the result of the statement you defined to them to the browser.Echo and print functions unline other function structure can be followed even with or without the paranteses.
Example of using Echo:
echo "this is without parenteses";
or with the parenteses thi the same result;
echo ("this …

12 March 2010  No comments

String Type in PHP

Post Thumbnail of String Type in PHP
 php-lesson1(variables)       

String Type
a string is simply a sequence of characters treated as a contiguous group.Such groups are
typically delimited by single or double quotes,
String Examples:
$str_sq = ‘single quat string’;
$str_dq = "double quat string";
$str_zc = "";//string with zero characters;
as I mentioned a string can be enclosed both in single and double quotation marks,that …

12 March 2010  No comments

NULL Type in PHP

Post Thumbnail of NULL Type in PHP
 php-lesson1(variables)       

The Type NULL has only one possible value which is the value NULL.To give a variable the NULL value you should simply assign it such as follows:
$MyVariable = NULL;
the NUL type is capitalized by convention, but in fact it is incasesensitive. you can give the NULL type in lowercase letter …

11 March 2010  No comments

Boolean Types in PHP

Post Thumbnail of Boolean Types in PHP
 php-lesson1(variables)       

Boolean contains TRUE or FALSE value, which is specificly used in if statements that is one of the baces in control structure.
Boolean provides constants that are TRUE and FALSE
Interpreting other Types as Booleans
there are also some cases that are interpreted as TRUE or False values when they act like a …

11 March 2010  No comments

Double Type in PHP

Post Thumbnail of Double Type in PHP
 php-lesson1(variables)       

doubles are floating point-numbers
I wil exmaple a double
Example:
$My_double = 385.874;
$My_double2 = 1.5;
$My_double3 = 0.556;
$My_double4 = 9.0;
$My_double5 = 0.00003;
when doubles are having a rounded number it will not save it as an integer, and will keep its type of format as a double
$another_double = $My_double4 + 10;
that will produce a doule …

6 March 2010  No comments

Integer Type in PHP

Post Thumbnail of Integer Type in PHP
 php-lesson1(variables)       

Integer types are simple, the contain the simple positive and negetive numbers and they can both assigned directly or bypassign an expression to a variable
Example:
$Myint= 684
$sample number = 8496-48683
yo can also assigne other integer bases instead of base 10 to a variable
for assigning base 8 just ad miness(-)behind the number …

6 March 2010  No comments

Variable Types in PHP

Post Thumbnail of Variable Types in PHP
 php-lesson1(variables)       

There are totally eight type is PHP;integeres, double, Booleans, strings, arrays, object, NULL and resources
here is to have a summary of all of these variables that PHP contains
Integers are the whole numbers without a decimal point like 34956
Doubles are floating-point-point numbers like 3.14159 or 56.0
Boolean has only two values
NULL is …

6 March 2010  2 comments

Constants in PHP

Post Thumbnail of Constants in PHP
 php-lesson1(variables)       

PHP offers constants which their value will not be reassigned regardless of ehat variables do so their value will be consistent.
Constants definitions: Constants do not have $ before their name and by convention they will be named with upercase letters.Constants have global scope which can be accessible within the function …

4 March 2010  No comments

Variable Scope In PHP

Post Thumbnail of Variable Scope In PHP
 php-lesson1(variables)       

Scope is a technical term which exist in every programming language, that provide a rule for name of the variables has the same meaning in two difrent places
any php variable not inside a function has global scope,meaning that if you assign avariable inside of a PHP file it will have …

4 March 2010  2 comments

Working with unset() function in PHP

Post Thumbnail of Working with unset() function in PHP
 php-lesson1(variables)       

if you are in a state to restore a variable to its unassigned state you can use unset() Function
Example:
unset($assigned_var)
this will make the $assigned_var variabel to the default value of which type it can hold no matter what assignement it has met so far.
this function will get a variable as an …

4 March 2010  No comments
 Page 1 of 2  1  2 »
CrossBlock designed by DeltaManual.Com  |  In conjunction with Web Hosting   |   Web Hosting   |   Reverse phone