| Papers | Home | visit my blog at http://prasannatechdotcom.blogspot.com | Contact Us |
|
|
|||
| PHP Tutorial: Lesson - 2 In the previous lesson 1, we have discussed about the introduction of PHP, how to use comments and about variables. In this lesson we will discuss about string variable, operations on string, various string functions, arithmetic, comparison and logical operators. Those who have good programming languages such as C, C++, Java will be able to understand the concepts easily as most of the below explanation is similar to the concepts in the above languages String variable: A string variable contains set of characters. The string variable is assigned with double quotes as mentioned in the below example <?php $str="Hello, World"; echo $str; ?> In the above example $str is a string variable and the string "Hello, World" is assigned to $str variable. When the above script is executed, the output of the script will be "Hello, World" The concatenation operator "." can be used to add two strings. For example <?php The above script displays Hello, World! For C Programmers who are familiar with C functions such as strlen(), strpos() etc.. can be used in PHP string operations. These functions are implemented for availability in PHP Library. Please see the complete strings function details in the help of PHP. Arithmetic operators:
Assignment operators
Comparison Operators
logical operators:
Do you feel above operators and its usage is familiar with you! In the next lesson 3 we will discuss about Control statements in PHP Send your feedback to feedback@prasannatech.com with Subject: PHP Tutorial |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Software developed by me are freeware and you are not required to pay any fees. However, if you like and appreciate, you can show your support by making a donation. It will help me to continue to develop new software, maintain already developed software and this web site.
Copyright (C), All rights reserved-2008
No warranty or guarantee not limited to these are provided with above free
software. Send your comments or feedback
to
feedback@prasannatech.com. For
advertising contact
advertise@prasannatech.com