Tuesday 18 February 2014

Filled Under:

how to get first 5 characters from string using php

               how to get first five characters from string using php. 

here is my string that ,

$str = 'easyscript4u.blogspot.in';

and i want to "easys" from a string than write like this,


$res = substr($str, 0, 5);
echo $res;

output :

easys 




0 comments:

Post a Comment