> String in php ~ Online tutorial

String in php

PHP String Variables
A string variable is used to store and manipulate text.
String Variables in PHP
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.

Function in String
strops()
strlen
Chunksplit()
addcslashes() and backcslahes()
chop()
chr()
implode()
nl2br()
strrev()
strlen()
substr()
trim()

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: