Home » PHP » limit the number of characters in a string php

limit the number of characters in a string php

String functions are have good role in php programming. Some times the php developer wants to limit the number of characters. In certain situations have one function. It is very useful and easy to apply
PHP Function is
Syntax: substr(string, <start position>,<end position>)
Eg: $string=’I am a web developer”;
substr($string,0,6); output: I am a

Leave a Reply

x

Check Also

Export Database using codeigniter

Database Utility Class : CodeIgniter PHP script to download mysql db-codeigniter,Backup MySQL database with CodeIgniter ...