PHP CoursePHP is a server scripting language, powerful tool formaking dynamic and interactive Web pages..This presentation...
Instructor Name: Mohamed Saad. Email: Engsaad_aly@hotmail.com Occupation: Web Developer In IT Big Dig.PHP Course Info@I...
PHP Course1: Variables & CommentsPHP Course Info@ITBigDig.com
Naming RulesPHP Course Info@ITBigDig.com• $ sign then Name of the variable.• Begin with a letter or the underscore charact...
VariablesScopesPHP Course Info@ITBigDig.comGlobal Declared outside of any function.LocalDeclared within a PHP function can...
VariablesData TypesPHP Course Info@ITBigDig.comString Hello Mohamed SaadInteger 48, -5, 160,…Double 2.209, -1.3, 3.14,…Boo...
PHP Course Info@itBigDig.comAthematic OperatorsOperator Name DescriptionA + B Addition Sum of A and BA - B Subtraction Dif...
DreamweaverCreate New SitePHP Course Info@itBigDig.comDreamweaver CS 6
DreamweaverFrom Site menu Select New SitePHP Course Info@itBigDig.comprojectNavigate to desktop andcreate New FolderDreamw...
DreamweaverConfigure Your ServerPHP Course Info@itBigDig.comNavigate to desktop andcreate New FolderDreamweaver CS 6
DreamweaverConfigure Your ServerPHP Course Info@itBigDig.comConfigure your serverDreamweaver CS 6
DreamweaverConfigure Your ServerDreamweaver CS 6PHP Course Info@itBigDig.comServer name any nameFTB Address DomainUsername...
DreamweaverConfigure Your ServerDreamweaver CS 6PHP Course Info@itBigDig.com
DreamweaverRename File: variables.phpDreamweaver CS 6PHP Course Info@itBigDig.com
PHP TagOpen variables.php and insert basic code<?php?>PHP Course Info@itBigDig.com
Copy CodeOpen variables.php and insert basic code<?php?>PHP Course Info@itBigDig.com<!DOCTYPE html><html><body><?php?></bo...
PHP String DataOutput Data<?phpecho “ ”;?>PHP Course Info@itBigDig.com
PHP String DataStore & Output Data<?php$VariableName= „Saad‟ ;?>PHP Course Info@itBigDig.com
PHP String DataConcatenation Operator<?phpecho $first . " " . $last ;?>PHP Course Info@itBigDig.com
PHP String DataGet Type Function<?phpecho gettype($user);?>PHP Course Info@itBigDig.com
<?phpecho strlen($user);?>PHP Course Info@itBigDig.comPHP String DataString Length Function
<?phpecho strpos("Hello","H")?>PHP Course Info@itBigDig.comPHP String DataSearch for a text
<?phpecho chr(65)?>PHP Course Info@itBigDig.comPHP String DataCharacter Function
<?phpecho chr(65)?>PHP Course Info@itBigDig.comPHP String DataCharacter Function
CommentsInsert comments & add remarks to your code.PHP Course Info@ITBigDig.comSingle Line• //Comments hereMulti Lines• /*...
Dig …?calculate the Area of square which have theLength of 4 cm.Print the result in• Meter (m).• Centimeter (Cm).• Millime...
AnswerPHP Course Info@ITBigDig.com
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><...
We hope You enjoy This Tutorial.For any Suggestions Please email UsInfo@ITBigDig.comPHP Course Info@ITBigDig.comEndVariabl...
Upcoming SlideShare
Loading in …5
×

PHP Variables & Comments 01

3,470 views

Published on

PHP Course
by:engsaad
http://itbigdig.com

Published in: Education, Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,470
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
53
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

PHP Variables & Comments 01

  1. 1. PHP CoursePHP is a server scripting language, powerful tool formaking dynamic and interactive Web pages..This presentation provide you with PHP source code and the HTMLoutput of that code………….Enjoy!.PHP Course Info@ITBigDig.com
  2. 2. Instructor Name: Mohamed Saad. Email: Engsaad_aly@hotmail.com Occupation: Web Developer In IT Big Dig.PHP Course Info@ITBigDig.com
  3. 3. PHP Course1: Variables & CommentsPHP Course Info@ITBigDig.com
  4. 4. Naming RulesPHP Course Info@ITBigDig.com• $ sign then Name of the variable.• Begin with a letter or the underscore character.• Name can only contain alpha-numeric characters andunderscores.• Name Should not contain spaces.• Variable names are case sensitive.• No command for declaring a variable.Variables
  5. 5. VariablesScopesPHP Course Info@ITBigDig.comGlobal Declared outside of any function.LocalDeclared within a PHP function can only be accessed within thatfunctionStaticWhen a function is completed, all of its variables are normallydeleted. However, sometimes you want a local variable to not bedeleted. use the static keyword .ParameterA parameter is a local variable whose value is passed to thefunction by the calling code.
  6. 6. VariablesData TypesPHP Course Info@ITBigDig.comString Hello Mohamed SaadInteger 48, -5, 160,…Double 2.209, -1.3, 3.14,…Boolean True or FalseDate 2015-12-31 12:55:22
  7. 7. PHP Course Info@itBigDig.comAthematic OperatorsOperator Name DescriptionA + B Addition Sum of A and BA - B Subtraction Difference of A and BA * B Multiplication Product of A and BA / B Division Quotient of A and BA % B Modulus Remainder of A divided by BA . B Concatenation Concatenate two strings
  8. 8. DreamweaverCreate New SitePHP Course Info@itBigDig.comDreamweaver CS 6
  9. 9. DreamweaverFrom Site menu Select New SitePHP Course Info@itBigDig.comprojectNavigate to desktop andcreate New FolderDreamweaver CS 6
  10. 10. DreamweaverConfigure Your ServerPHP Course Info@itBigDig.comNavigate to desktop andcreate New FolderDreamweaver CS 6
  11. 11. DreamweaverConfigure Your ServerPHP Course Info@itBigDig.comConfigure your serverDreamweaver CS 6
  12. 12. DreamweaverConfigure Your ServerDreamweaver CS 6PHP Course Info@itBigDig.comServer name any nameFTB Address DomainUsername FTP UserPassword FTP PassRoot Folder on yourhostFor this Tutorial I created aDemo folder on my host and wewill use it along
  13. 13. DreamweaverConfigure Your ServerDreamweaver CS 6PHP Course Info@itBigDig.com
  14. 14. DreamweaverRename File: variables.phpDreamweaver CS 6PHP Course Info@itBigDig.com
  15. 15. PHP TagOpen variables.php and insert basic code<?php?>PHP Course Info@itBigDig.com
  16. 16. Copy CodeOpen variables.php and insert basic code<?php?>PHP Course Info@itBigDig.com<!DOCTYPE html><html><body><?php?></body></html>
  17. 17. PHP String DataOutput Data<?phpecho “ ”;?>PHP Course Info@itBigDig.com
  18. 18. PHP String DataStore & Output Data<?php$VariableName= „Saad‟ ;?>PHP Course Info@itBigDig.com
  19. 19. PHP String DataConcatenation Operator<?phpecho $first . " " . $last ;?>PHP Course Info@itBigDig.com
  20. 20. PHP String DataGet Type Function<?phpecho gettype($user);?>PHP Course Info@itBigDig.com
  21. 21. <?phpecho strlen($user);?>PHP Course Info@itBigDig.comPHP String DataString Length Function
  22. 22. <?phpecho strpos("Hello","H")?>PHP Course Info@itBigDig.comPHP String DataSearch for a text
  23. 23. <?phpecho chr(65)?>PHP Course Info@itBigDig.comPHP String DataCharacter Function
  24. 24. <?phpecho chr(65)?>PHP Course Info@itBigDig.comPHP String DataCharacter Function
  25. 25. CommentsInsert comments & add remarks to your code.PHP Course Info@ITBigDig.comSingle Line• //Comments hereMulti Lines• /*Comments hereComments here*/
  26. 26. Dig …?calculate the Area of square which have theLength of 4 cm.Print the result in• Meter (m).• Centimeter (Cm).• Millimeter (mm).PHP Course Info@ITBigDig.com
  27. 27. AnswerPHP Course Info@ITBigDig.com
  28. 28. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Square Area</title></head><body><?php$x=1;//legnth in centimeterecho "Length of the square =$x <br/>";//Print out the length$meter=$x/1000;//legnth in meter$Ameter =$meter*$meter;//Area in meterecho "Area of the square= $Ameter M<sup>2</sup> <br/>";$Acent = $x*$x;//Area in centimeterecho "Area of the square= $Acent Cm<sup>2</sup> <br/>";$milli =$x*1000;//legnth in millimeter$Amilli=$milli*$milli;//Area in millimeterecho "Area of the square= $Amilli mm<sup>2</sup>";?></body></html>PHP Course Info@ITBigDig.comCopy Code
  29. 29. We hope You enjoy This Tutorial.For any Suggestions Please email UsInfo@ITBigDig.comPHP Course Info@ITBigDig.comEndVariables & CommentsItbigdig.com

×