Friday, June 7, 2013

PHP

1 Welcome to PHP! 

An introduction to the PHP programming language.

Introduction to PHP

  PHP is a programming language that can do all sorts of things: evaluate form data sent from a browser, build custom web content to serve the browser, talk to a database, and even send and receive cookies (little packets of data that your browser uses to remember things

Why Learn PHP?
php can write to server java can write to client  
<?php echo "My first line of PHP!" ?>

Just a New Tag
<?php echo 40 + 2; ?>
A Bit of PHP History

PHP (originally Personal Home Page, but now PHP: Hypertext Preprocessor) was created by Rasmus Lerdorf in 1995. Lerdorf came up with PHP just to maintain his personal home page (hence the name), but it has since grown to become one of the most popular programming languages in use today.

Echo

<?php echo "Ajab!"; ?>
Arithmetic

<?php echo 17 * 123;>
Strings

A string is a word or phrase between quotes. You can type a string all at once  "ajab khan"; Or use the concatenation operator, which glues several strings together:"ajab"."khan";

Variables

A variable is just a name PHP uses to keep track of a value. <?php $ajab="text"; ?>

Semicolons (;)

You can think of a statement is a complete   <?php  echo "ajab";?>

Comments

short <?php //hellow this is comment ?>
  long
<!-- this one is also comment -->

No comments:

Post a Comment