intro about php,php training in jaipur
TRANSCRIPT
![Page 1: Intro about PHP,PHP Training in jaipur](https://reader030.vdocuments.mx/reader030/viewer/2022032419/55a3d8541a28abc4448b4763/html5/thumbnails/1.jpg)
Horizon Software Solutions
http://phptraininginjaipur.info/
![Page 2: Intro about PHP,PHP Training in jaipur](https://reader030.vdocuments.mx/reader030/viewer/2022032419/55a3d8541a28abc4448b4763/html5/thumbnails/2.jpg)
http://phptraininginjaipur.info/
PHP Introduction
![Page 3: Intro about PHP,PHP Training in jaipur](https://reader030.vdocuments.mx/reader030/viewer/2022032419/55a3d8541a28abc4448b4763/html5/thumbnails/3.jpg)
What is PHP ??
PHP is Hyper Text Processor
– Other Names : Personal Home Page, Professional Home Page
• Is a server side scripting language.– Capable of generating the HTML pages
• HTML generates the web page with the static text and images.
• However the need evolved for dynamic web based application, mostly involving database usage.
• http://phptraininginjaipur.info/
![Page 4: Intro about PHP,PHP Training in jaipur](https://reader030.vdocuments.mx/reader030/viewer/2022032419/55a3d8541a28abc4448b4763/html5/thumbnails/4.jpg)
How PHP Works??
http://phptraininginjaipur.info/phttp://phptraininginjaipur.info/
![Page 5: Intro about PHP,PHP Training in jaipur](https://reader030.vdocuments.mx/reader030/viewer/2022032419/55a3d8541a28abc4448b4763/html5/thumbnails/5.jpg)
PHP Language Features
• PHP language features such as control structures, operators, variable types, function declaration, class/object declaration are almost similar to any compiled or interpreted language such as C or C++.
• http://phptraininginjaipur.info/
![Page 6: Intro about PHP,PHP Training in jaipur](https://reader030.vdocuments.mx/reader030/viewer/2022032419/55a3d8541a28abc4448b4763/html5/thumbnails/6.jpg)
PHP Data Types
Three basic data types– Integer– Double– String
• More data types– Array– Object
• PHP is an untyped language – variables type can change on the fly.
– http://phptraininginjaipur.info/
![Page 7: Intro about PHP,PHP Training in jaipur](https://reader030.vdocuments.mx/reader030/viewer/2022032419/55a3d8541a28abc4448b4763/html5/thumbnails/7.jpg)
PHP Constants
• ..values that never changes• Constants are defined in PHP by using the define()
function.– For e.g.
define(“NCST”, “National Centre for Software Technology”)
• defined() function says whether the constant exists or not.
• http://phptraininginjaipur.info/
![Page 8: Intro about PHP,PHP Training in jaipur](https://reader030.vdocuments.mx/reader030/viewer/2022032419/55a3d8541a28abc4448b4763/html5/thumbnails/8.jpg)
PHP Variables
• The variables in PHP are declared by appending the $ sign to the variable name.– For e.g
$company = “NCST”;
$sum = 10.0;
• variable’s data type is changed by the value that is assigned to the variable.
• Type casting allows to change the data type explicitly.
• http://phptraininginjaipur.info/
![Page 9: Intro about PHP,PHP Training in jaipur](https://reader030.vdocuments.mx/reader030/viewer/2022032419/55a3d8541a28abc4448b4763/html5/thumbnails/9.jpg)
PHP Operators
• All the operators such as arithmetic, assignment, Comparison, and logical operators are similar to the operators in C and C++.
• In PHP the string concatenation operator is denoted by ‘.’.– For e.g.
• $name = “My name is”.$myname;
• http://phptraininginjaipur.info/
![Page 10: Intro about PHP,PHP Training in jaipur](https://reader030.vdocuments.mx/reader030/viewer/2022032419/55a3d8541a28abc4448b4763/html5/thumbnails/10.jpg)
PHP Statements
• IF statement if (<condition>) {
//php code goes here}
else {//php code goes here}
• Alternative Syntaxif(<condition>) :
//html code goes here
else ://html code goes here
endif;http://phptraininginjaipur.info/
![Page 11: Intro about PHP,PHP Training in jaipur](https://reader030.vdocuments.mx/reader030/viewer/2022032419/55a3d8541a28abc4448b4763/html5/thumbnails/11.jpg)
PHP Statements (cont.)
• For loopfor($i=0;$i < 10;$++i) {
echo(“the value is :”. $i);
}– Alternative Syntax
for($i=0;$i < 10;$++i) :// html code goes here
endfor;
• While loop
• Do-While loop
• http://phptraininginjaipur.info/
![Page 12: Intro about PHP,PHP Training in jaipur](https://reader030.vdocuments.mx/reader030/viewer/2022032419/55a3d8541a28abc4448b4763/html5/thumbnails/12.jpg)
Arrays
. contains value set• each element has a value, data stored in the element.
• And has a key by which the element can be referred to
• http://phptraininginjaipur.info/
![Page 13: Intro about PHP,PHP Training in jaipur](https://reader030.vdocuments.mx/reader030/viewer/2022032419/55a3d8541a28abc4448b4763/html5/thumbnails/13.jpg)
Initializing Arrays
• No of ways to initialize the array.– For e.g.
• $ncststaff[] = “amrish”;
$ncststaff[] = “murali”;
$ncststaff[] = “narayan”;• $ncststaff[123] = “amrish”;
$ncststaff[122] = “murali”;
$ncststaff[121] = “narayan”;• $ncststaff = array (“amrish”, “murali”, “narayan”);
– to change the indices of the array use => operator.
–http://phptraininginjaipur.info/
![Page 14: Intro about PHP,PHP Training in jaipur](https://reader030.vdocuments.mx/reader030/viewer/2022032419/55a3d8541a28abc4448b4763/html5/thumbnails/14.jpg)
Accessing the Array Elements
– Array_walk(<arrayname>,<function_name>)
• function_name is the function that is written for every member of an array.
• For e.g
$ncststaff = array (“amrish”, “murali”, “narayan”);
array_walk ($ncststaff, printstaff);
// function to print each element of the array
function printstaff($names) {
echo “<B>$names</B><BR>\n”;}
http://phptraininginjaipur.info/
![Page 15: Intro about PHP,PHP Training in jaipur](https://reader030.vdocuments.mx/reader030/viewer/2022032419/55a3d8541a28abc4448b4763/html5/thumbnails/15.jpg)
To see more:http://phptraininginjaipur.info/
![Page 16: Intro about PHP,PHP Training in jaipur](https://reader030.vdocuments.mx/reader030/viewer/2022032419/55a3d8541a28abc4448b4763/html5/thumbnails/16.jpg)
Thank You !!
Horizon Software Solutions http://phptraininginjaipur.info/