php training in noida,delhi,bhopal
TRANSCRIPT
Nikhil Joshi
1
PHP Overview
Presented By Nikhil Joshi
Nikhil Joshi
2
CONTENTS
• Background•History• CSS
Nikhil Joshi
3
Backgounrd
• PHP is server side scripting system
– PHP stands for "PHP: Hypertext Preprocessor" – Syntax based on Perl, Java, and C– Very good for creating dynamic content– Powerful, but somewhat risky!
Nikhil Joshi
4
PHP is a server-side scripting language designed primarily for web development but Is also used as a general purpose programming language. Originally created by Rasmus Lerdorf in 1994
Developer of PHP IS Zend Technologies
Latest version of PHP is 7.0.10
Nikhil Joshi
5
Syntax of PHP
<html><head><title> Example </title></head> <body><?php echo “hi, I’m a php script”; ?> </body> </html>
Nikhil Joshi
6
Layout
Layout can be designed using 2 ways :-
• Tabular• Division
Tabular- Area taken on the basis of <tr> <td> tags.Division- Division is area taken by <div> on the web pages but it is invisible itself as long as you defines it’s border or background.
Nikhil Joshi
7
CSS
It is used mainly for desining in Webpage.
3 Types of CSS
• Inline• Internal• External
Nikhil Joshi
8
Inline - within a line that is inline that is inline CSS is used within the line of HTML tag and it’s syntax is :-
<tag_name Style=“at:value;at2value;a+3value”><p style=“color:red;font-size:50px;backgroundcolor:green”>Nikhil</p>
External - External CSS is maintained on the extra sheet and save this page with .css extention and link this CSS to the particular html page
<link REL="STYLESHEET" TYPE="text/css" HREF="[Style sheet URL]">
Internal - An internal stylesheet holds the CSS code for the webpage in the head section of the particular file. This makes it easy to apply styles like classes or id's in order to reuse the code.
<style> p { font-size: 20px; font-weight: bold; } </style>
Nikhil Joshi
9
Selectors
• Id Universal• Class parent/child Hierarchial• Element(Tag) pseudo selector(Event like
hover)
Id- Id selector is used in a HTML by using Id attribute like <p id=“one”>Ram</p> <p id=“two”>Mohan</p> <p id=“three”>Sohan</p>
And maintain the Id using CSS by using # symbol with id name
Nikhil Joshi
10
Class Selector
The working of class selector is similar like Id selecetor but difference is that in place Of Id.We use class in html tag & in place of # symbol we use . Symbol in a CSS.
Element Selector
Element selector is directly taken by it’s tag name that’swhy it is also known tag selector.
Nikhil Joshi
11
Universal SelectorUniversal Selector is applicable globally on the whole pages & it is maintained In CSS using abstract symbol in CSS.
Parent/child Selector<html><head></head><body>
<ul><li> oil </li>
</ul><ol>
<li> oil </li></ol>
</body></head></html>
Nikhil Joshi
12
Pseudo Selector
It is used for mainly perform events.
one.cssOl li{
color:red;fontsize: 40px;background_color:green;
}Ol li:hover{
color:yellow;fontsize:20px;
}
Nikhil Joshi
13
Control Statements
There are 3 types of control statements1) if Statement2) if else Statement3) if else if Statement
If Statement If (expression){
code to be executed}
<html><head></head><body><script>
var a=40;if(a>20)
Nikhil Joshi
14
{Document.write(“value is greater than 20”)}
</script></body></html>
It evaluates the content only if the expression is true.If else Statement
It evaluates the content wether the condition is true or falseIf(expression){Code to be executed}Else{}
Nikhil Joshi
15
<html><head></head><body><script>
var a=20;if(a%2==0){Document.write(“value is even”)}else{document.write(“value is odd”)}
</script></body></html>
Nikhil Joshi
16
If else if Statement
It evaluates the content only if expression is true from several conditions
If(expresssion 1){}elseif(expression 2){}elseif(expression 3) {}else{}
Nikhil Joshi
17
<html><head></head><body><script>
var a=20;if(a==10){
document.write(a is equal to 10);}else if(a==15){
document.write(a is equal to 15);}else if(a==20){
document.write(a is equal to 20);}else{document.write(a is not equal to 10,15,20)}
</script></body></html>
Nikhil Joshi
18
Strings
A String is a sequence of characters used to store and manipulate texts.There are various functions to manipulate strings
• Strrev() This function is used to check the palindrome series of names and characters<html><head></head><body><?php
$a=“nitin”;if(strrev($a)==$a){
echo”name is palindrome”;}else{echo”name is not palindrome”;}
?></body></html>
Nikhil Joshi
19
• Str_repeat()- If we want to repeat the object of the strings number of times then we use string repeat function.
<html><head></head><body><?php
$a=“welcome”;echo str_repeat($a,4);
?></body></html>• Str_replace()- It is used to replace the characters<html><head></head><body><?php
$a=“welcome”;echo str_replace(“e”,”@”,$a);
?></body></html>
Nikhil Joshi
20
• Str_word_count() – It is used to count the number of words in a string<html><head></head><body><?php
$a=“welcome to the world of php”;echo str_word_count($a);
?></body></html>• Strcmp() – This function is used to compare the 2 strings<html><head></head><body><?php
$a=“hello”;$a1=“hello”;echo strcmp($a,$a1)
?></body></html>
Nikhil Joshi
22
File Handling In PHP
The file system functions allow us to acess and manipulate the file.File system provides a concept to start a specific data using different types of file format.that means file give us linear type database concept.• How to create a file via PHPThe touch function is used to create a file <?php
touch(“resume.doc”);touch(“a.pdf”);touch(“b.txt”);
?>• How can we delete a file via PHP codeThe Unlink function is used to delete a file.<?php
unlink(“resume.doc”);unlink(“a.pdf”);unlink(“b.txt”);
?>• How can we copy a file by PHPThe copy function is used to copy a file.<?php
copy(“name of file with extention,name of destination file with etension”);?>
Nikhil Joshi
23
• How can we rename a gift by PHP code Rename function is used to rename a file.<?php
rename(“name of file with extension”)?>• How can we check whether a file or a destination file is exist or not The file_exist function is used to check the file or directory existance<?php
echo file_exists(“resume.doc”);?>• How can we check the size of the file by php code filesize function is used to check the size of the file<?php
echo filesize(“resume.doc”);?>• How can we check the path of the file. realpath function is used to check the path of the file<?php
echo realpath(“resume.doc”);?>
Nikhil Joshi
24
Best PHP Training in Noida , Delhi , Bhopal by KVCH
Nikhil Joshi
25
THANK YOU