Friday 19 April 2013

PHP String


String variable used to manipulate the data in the form of text.

String variable in PHP.
Variable string used to store the character in the form of text / font.

EXAMPLE:
<? php
$ text = 'Welcome';
echo $ text; / / it will be printed the words "welcome"
?>

Concatenation operator.
This operator is used to connect two strings into one output variable.

example:
<? php
$ text = 'Welcome';
$ where = 'in welcome.com';
echo $ text. $ where; / / it will be printed the words "Welcome to welcome.com"
?>

Strlen function.
Function "strlen ()" is used to calculate the number of characters.

EXAMPLE:
<? php
$ text = 'Welcome';
strlen ($ text); / / it will print 14
strlent ('Welcome'), / / it will print 14
?>

Srtpost Function.
In gunkan to know or look for special characters.

EXAMPLE:
<? php
$ text = 'Welcome';
strpost ($ text, 'a'), / / it will be printed 4
strpost ('Welcome'), / / it will be printed 4
?>
explanation:
Strpost function () will only count the number of the letter "a" in the variable $ text.

No comments:

Post a Comment