Welcome to Help4Web.co.uk - Web Design Help, Html Tutorial, Php, Asp , SQL help and CCNA, MCSE definitions!
Google
Webkpop-web.com

     Main Menu

· Home
· Free Downloads
· Computing FAQ
· Contact Us
· Free Software Downloads
· Tech Forum
· Technology News
· Web Design Help
· Web Links
· Your Online Account
· Your PM



     Web Browser


     Website Links
Supermediastore! #1 in Computer media & Accessory

White Papers IT
Learn Korean
Chinese Pop Music
Advertise Kpop
Korean Pop Site Map
Web Design
Pop Music
Chinese Girls
HK Pop Korean Music
Lee Hyori
Hyori
Boa Park Ji Yoon
Baby Vox YG Family
Jeon Ji Hyun
1 Tym Ha Ji Won
Shyne Rain Bi
Shin Mina SM Town
Fly to the Sky
Korean Girls and Models
Nicholas Tse
161 Clan
보아
Edison Chen
Sung Hi Lee
Shinhwa
Andy Lau Jay Chou
White Papers
Case Study SES
Kelly Chen
Liu Yi Fei Sammi Cheng
Jordan Chan Music
Computer Jobs IT

Php Lesson 1 :- Basic Php Operations

(383 reads)   



Using Basic PHP Syntax

A Php file contains Php Scripting as well as HTML Tags.

Here is a PHP script which sends the text "Hello World" to the browser:

<html>
<body><?php echo "Hello World"; ?></body>
</html>

The PHP scripting block always starts with <?php and ends with ?>. A PHP scripting block can be placed anywhere in the document.

Each code line in PHP must end with a semicolon. The semicolon is a separator and is used to distinguish one set of instructions from another.

There are two basic statements to output text with PHP: echo and print. In the example above we have used the echo statement to output the text "Hello World".


Using Variables in PHP

When using Php all variables in PHP start with a $ sign symbol. Some Php variables may contain strings, numbers, or arrays.

Below, the PHP script assigns the string "Hello World" to a variable called $txt:

<html>
<body><?php
$txt="Hello World";
echo $txt;
?></body>
</html>

In Php to concatenate two or more variables together, use the dot (.) operator:

<html>
<body><?php
$txt1="Hello World";
$txt2="1234";
echo $txt1 . " " . $txt2 ;
?></body>
</html>

The output of the script above will be: "Hello World 1234".


Using comments in PHP

When using PHP, we use // to make a single-line comment or /* and */ to make a large comment block.

<html>
<body><?php//This is a comment/*
This is
a comment
block
*/?></body>
</html>


Using PHP Operators

Here is a list of PHP operators.

Php Arithmetic Operators

Operator Description
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus (division remainder)
++ Increment
-- Decrement

Php Assignment Operators

Operator Example
= x=y
+= x+=y
-= x-=y
*= x*=y
/= x/=y
%= x%=y

Php Comparison Operators

Operator Description
== is equal to
!= is not equal
> is greater than
< is less than
>= is greater than or equal to
<= is less than or equal to

Php Logical Operators

Operator Description
&& and
|| or
! not
  

[ Back to Php Help | Web Help Index ]






Learn Chinese | Learn cantonese | Learn Mandarin | Grace Park | Party Organisers | Kaila yu | Phone Card | Twins | Chinese Society | Loans UK | BokuMaro | CV Help Book | Chinese Wife | Korean Singles | British Born Chinese | Bae Yong Jun | Speak Korean | Chinese Models | Music | Information Security Management | Maritime Greenwich Campus | Covering Letters Help | Chinese Music | Jang Nara | SES | YG Family | Learn Korean | Firewall Definition | Server Definition | Wireless Network Definition | E-Commerce Definition | Sales Leads | Application Firewall | CCNA definitions | Research Papers | Webcast | CV Help

Author KPop Music :- Jon Bock ( Chinese Pop Music Learn Korean )
Produced by Kpop-Web Design Associates, all rights not reserved.
Internet Marketing and Search Engine Optimisation Software Defined Radio