Php

601 views

Published on

PHP stands for "PHP Hypertext Preprocessor”
An embedded scripting language for HTML like ASP or JSP
A language that combines elements of Perl, C, and Java

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

  • Be the first to like this

No Downloads
Views
Total views
601
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
24
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Php

  1. 1. Guru99 DEVELOPING WEB APPLICATIONS WITH PHP RAD for the World Wide Web Guru99 By. Krishna Rungta
  2. 2. INTRODUCTION hat is PHP? • PHP stands for "PHP Hypertext Preprocessor” • An embedded scripting language for HTML like ASP or JSP • A language that combines elements of Perl, C, and Java Guru99
  3. 3. Guru99 INTRODUCTION istory of PHP • Created by Rasmus Lerdorf in 1995 for tracking access to his resume • Originally a set of Perl scripts known as the “Personal Home Page” tools • Rewritten in C with database functionality • Added a forms interpreter and released as PHP/FI: includes Perl-like variables, and HTML embedded syntax
  4. 4. PHP LANGUAGE BASICS ello World!: An Example • Like Perl, there is more than one way to do it • <?php echo “Hello World!”; ?> • <?php $greeting = “Hello World!” printf(“%s”, $greeting); php?> Guru99
  5. 5. PHP LANGUAGE BASICS onstants, Data Types and Variables • Constants define a string or numeric value • Constants do not begin with a dollar sign • Examples: • • • • define(“COMPANY”, “Acme Enterprises”); define(“YELLOW”, “#FFFF00”); define(“PI”, 3.14); define(“NL”, “<br>n”); Guru99
  6. 6. PHP LANGUAGE BASICS onstants, Data Types and Variables • Using a constant • print(“Company name: “ . COMPANY . NL); Guru99
  7. 7. PHP LANGUAGE BASICS onstants, Data Types and Variables • Data types • Integers, doubles and strings • isValid = true; // Boolean • 25 // Integer • 3.14 // Double • ‘Four’ // String • “Total value” // Another string Guru99
  8. 8. PHP LANGUAGE BASICS onstants, Data Types and Variables • Data types • Strings and type conversion • $street = 123; • $street = $street . “ Main Street”; • $city = ‘Naperville’; $state = ‘IL’; • $address = $street; • $address = $address . NL . “$city, $state”; • $number = $address + 1; // $number equals 124 Guru99
  9. 9. PHP LANGUAGE BASICS onstants, Data Types and Variables • Data types • Arrays • Perl-like syntax • $arr = array("foo" => "bar", 12 => true); • same as • $arr[“foo”] = “bar”; • $arr[12] = true;
  10. 10. PHP LANGUAGE BASICS onstants, Data Types and Variables • Arrays (cont.) • <?php $arr = array("somearray" => array(6 => 5, 13 => 9, "a" => 42)); echo $arr["somearray"][6]; // 5 echo $arr["somearray"][13]; // 9 echo $arr["somearray"]["a"]; // 42 ?>
  11. 11. PHP LANGUAGE BASICS onstants, Data Types and Variables • Objects • Currently not much more advanced than than associative arrays Using constants • Before version 5.0, objects are passed by value • Slow • Functions can not easily change object variables
  12. 12. TRICKS AND TIPS ebugging • Feature: PHP is not a strongly typed language • Variables can be created anywhere in your code • Undocumented Feature: PHP is not a strongly typed language • Typos in variable names will cause stuff to happen
  13. 13. RESOURCES • To Learn more thing about PHP Just Visit our site • http://web.guru99.com/ • Thank You

×