Search

String Variables in PHP PDF Print E-mail
User Rating: / 1
PoorBest 
Programming - PHP
Monday, 20 July 2009 08:05
Article Index
String Variables in PHP
String Variables in PHP
All Pages

 

 

String variables are used for values that contains characters.

In this chapter we are going to look at the most common functions and operators used to manipulate strings in PHP.

After we create a string we can manipulate it. A string can be used directly in a function or it can be stored in a variable.

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

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

The output of the code above will be:

Hello World

Now, lets try to use some different functions and operators to manipulate the string.




 

Add comment


Security code
Refresh

We have 75 guests online