Skip to main content

Posts

White space in PHP

White space in PHP : <html> <head> <title>My First PHP Page</title> </head> <body> <?php echo "Hello World!";                  /*As with HTML, whitespace is ignored between PHP statements.                                       This means it is OK to have one line of PHP code, then 20 lines of blank space                                       before the next line of PHP code. You can also press tab to indent your code and                                       the PHP interpreter will ignore those spaces as well. like from line 9 to line                      ...

First page of php

<html> <head> <title>My First PHP Page</title> </head> <body> <?php echo "Hello World!";  /* echo is used for the output statement so here the string [my first page of php will be                   will be displayed. The string should be in the " " for displying   */ ?> </body> </html>

Syntax of Php

PHP SYNTAX: Before we talk about PHP's syntax, let us first define what syntax is referring to. Syntax - The rules that must be followed to write properly structured code. PHP's syntax and semantics are similar to most other programming languages C, Java, Perl) with the addition that all PHP code is contained with a tag of sorts. All PHP code must be contained within the following: <?php All stuff will be in the between of this       ?>

Introduction to PHP

Introduction to php: PHP stands for Hypertext Preprocessor. 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. Why world need php: There are number of server side scripting available like ASP, SSJS, JSP….. PHP involves simplicity in scripting (..generally using the database) platform independence. PHP is primarily designed for web applications well optimized for the response times needed for web applications Is an open source. Data types of php: Three basic data types Integer Double String More data types Array Object PHP is an untyped language variables type can change on the fly.

Prefix and Post fix

Prefix and Post fix #include<iostream>     // it is  a library used for display #include<conio.h>      // its is also a library used for input output statement using namespace std; // Prefix increment and post fix increment main() { int a=3,b=4; cout<<".........Prefix increment.........."<<endl; cout<<"previous value of b="<<b<<endl;   // as we know what is happening here  cout<<++b<<"=due to prefix increment"<<endl;          /*as form the name prefix increment its increment value before using it in the program                       like b=4 so ++b mean increment a value before its get use */ cout<<".........Post fix increment.........."<<endl; cout<<"previous value of a="<<endl;  // as we know what is happening here cout<<"value of a is =\t"<<a++...