HomePHP Page 4 - Programming PHP: A Beginner`s Guide
Working with Strings - PHP
PHP has been taking the web by storm because of its power and versatility. If you'd like to add PHP-based applications to your web site, keep reading. This series of articles will teach you the language from scratch.
The above code is called concatenation and is used to join two things together (in this case, two words). The above code prints out the text:
You will note the " " places a space between the words.
There are a ton of functions that let you goof around with strings in PHP, and I will write a tutorial on them in the near future.
In addition to toying with strings, you can also manipulate numeric data as well. To do this we use operators. Below is a giant list of the different operators available to you in PHP.
What it Does
Used for Addition
Used for Subtraction
Used for Multiplication
Used for Dividing
Used for Modulation
Used to increase value by one
Used to decrease value by one
Used to Assign a Value
Used to Add and Assign a Value
Used to Subtract and Assign a Value
Used to Multiply and Assign a Value
Used to Divide and Assign a Value
Decimals and Adds a Value
Used to Modulate and Add a Value
Not Equal To
Greater Than or Equal To
Less Than or Equal To
Checks for more than one criteria
Checks to see if at least one of a set of criteria is true
Checks to see if a criteria is not true
Well that's all the time we have for this tutorial. In our next episode, we will discuss how to use the various operators to further manipulate our data. If we have time we discuss Conditional Statements as well.