PHP Strings

by Anu Gaba 20-Dec-15

0 1489

PHP Strings is very interesting part in PHP. A PHP String is a series of characters, where character is same as byte.

PHP Strings

See Some Example for get more knowledge :

How it works..

a) PHP String Length Function

The PHP strlen() function returns the length of string.

echo strlen("Hello India!!");


b) PHP String Position Function

The strpos() function is use to search for a string or any character into string.

echo strpos("Hello ontime","ontime");

Result: 6

c) PHP String - Replace text

he PHP str_replace() function replace characters with other characters into string

echo str_replace("World", "Asia", "Hello World");

Result: Hello Asia

// (In this example through PHP String Replace Text, World replaces with Asia


Discount Coupons

Leave a Reply


    Waiting for your comments