Tuesday 7, February 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    Forum    |    About Us    |    Contact 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
  ASP Tutorial
ASP Tutorial
 
Client Side Scripting Tutorials
  JavaScript Tutorial
JavaScript Tutorial
  VBScript Tutorial
VBScript Tutorial
 
 
 
POPULAR E-BOOKS
 
Download Algorithms in the Real World: Lecture Notes  Ebook Algorithms in the Real World: Lecture Notes
   
Download The Greatest Marketing Secrets of the Ages Ebook The Greatest Marketing Secrets of the Ages
   
Download HOW TO GENERATE MASSIVE AMOUNTS OF TRAFFIC ON A SHOESTRING BUDGET Ebook HOW TO GENERATE MASSIVE AMOUNTS OF TRAFFIC ON A SHOESTRING BUDGET
   
Download Open Source Security Tools: Practical Guide to Security Applications  Ebook Open Source Security Tools: Practical Guide to Security Applications
   
Download Make Money Online Ebook Make Money Online
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz