Tuesday 7, September 2010
      Home       Tutorials       Free Ebooks       Free Scripts       Tech News       Articles       About Us

Strings

String variables are used to store and manipulate a piece of text.

$msg="Hello World";
echo $msg;

?>

 

The output will be

Hello World

 

The Concatenation Operator
Dot (.) is used as concatenation operator. To concatenate two variables together, use the dot (.) operator:
$str1="Hello World";
$str2="Adam";
echo $ str1. " " . $ str2;
?>

 

Hello World Adam

 

Length of a String:

The strlen() function is used to find the length of a string.

$string=”Hello World”;

echo strlen($string);

?>

 

Output will be

11

 

The strpos() function:
The strpos() function is used to search for a string or character within another string.
If the string is found in the string, this function will return the position of the first match. If no match is found, it will return FALSE.
echo strpos("Example of strops function","of");
?>

The output will be

8

 

   
 
PHP Tutorial
 
  Introduction
Introduction
  Variables
Variables
  Strings
Strings
  Operators
Operators
  If Else Statement
If Else Statement
  Loops
Loops
  Functions
Functions
  Forms
Forms
  Sessions
Sessions
  Cookies
Cookies
  Files
Files
  E-mail
E-mail
  Error Handling
Error Handling
  File Upload
File Upload
  PHP Databases
PHP Databases
  Connecting to a MySQL Database
Connecting to a MySQL Database
  MySQL Data Types
MySQL Data Types
  Inserting Data Into a Table
Inserting Data Into a Table
  Select Statement
Select Statement
  Where Clause
Where Clause
  Order By
Order By
  Update Statement
Update Statement
  Delete From Statement
Delete From Statement
 
 
 
Web Designing Tutorials
  HTML Tutorial
HTML Tutorial
  DHTML Tutorial
DHTML  Tutorial
  CSS Tutorial
CSS Tutorial
  XHTML Tutorial
XHTML Tutorial
 
Programming Languages Tutorials
  C Language Tutorial
C Language Tutorial
  C++ Tutorial
C++ Tutorial
  Java Language Tutorial
Java Language Tutorial
  Data Structure Theory Tutorial
Data Structure Theory Tutorial
 
Server Side Scripting Tutorials
  PHP Tutorial
PHP Tutorial
  SQL Tutorial
SQL Tutorial
 
Client Side Scripting Tutorials
  JavaScript Tutorial
JavaScript Tutorial
  VBScript Tutorial
VBScript Tutorial
 
 
 
POPULAR E-BOOKS
 
Download Affiliate Marketing Success Ebook Affiliate Marketing Success
   
Download Algorithmic Problem Solving  Ebook Algorithmic Problem Solving
   
Download Supercharged eBook Creation Leaked Chapter  Ebook Supercharged eBook Creation Leaked Chapter
   
Download Blog for Dollar Ebook Blog for Dollar
   
Download  100 000  Worth of the Biggest Money Making Secrets Ever Revealed Ebook 100 000 Worth of the Biggest Money Making Secrets Ever Revealed
   
Technology News      
Studiesinn.com © 2010 All Rights Reserved.