PHP String Variables

Submitted by admin on

A string variable is used to manipulate any character stored in a variable you declared.

This chapter will discuss common function you can use to manipulate string variables.

Some common functions are:

  • The Concatenation Operator
  • The strlen() function
  • The strpos() function

The concatenation operator is very useful to combine two string values.

Example:

LulzSec Hacked Three Websites So Far: PBS.org, Sony Pictures and Infragard.net

Submitted by admin on
Just this May 2011, LulzSec hacked pbs.org followed by Sony Pictures. LulzSec or known as Lulz Security, a computer hacker group, hacked another website this month and stole 180 passwords from Infragard.net. Infragard.net is a program run by FBI to gain support through Information Technology. The aim of this program is to exchange information to FBI to crack down cyber terrorist. Infragard exist

PHP Variables

Submitted by admin on

A variable is used to store any value that you like.

You can reuse variable in any block of code in your PHP script.

PHP variables must start with a dollar ($) sign.

PHP Variable Syntax

$variable_name = value;

Below is an example of how to use variables in PHP:

PHP Syntax

Submitted by admin on

If you came from other programming languages like c/c++ and or Java, you will not have difficulty understanding PHP syntax as they have the same thing in common.

But unlike c/c++ or Java, PHP script is executed on the server and can be inserted within any HTML code and must start scripting block with <?php and end with ?>.

Below is an example of PHP file: