how to get substring of string without using substr() function in php ????

Answer Posted / nadeem sartawi

Write a PHP function that Returns the part of string
specified by the start and length parameters.

Hint 1: the function accepts three parameters.
Parameter:Description
string :Required. Specifies the string to return a part of
start :Required. Specifies where to start in the string
length :Optional. Specifies the length of the returned
string. :Default is to the end of the string.
Hint 2: YOU ARE NOT ALLOWED TO USE THE "substr" FUNCTION.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the visibility of the property or method?

777


Is age nominal or ordinal?

702


What are the Formatting and Printing Strings available in PHP?

798


Tell me how do I escape data before storing it into the database?

760


What is constructors and destructors?

726


What is php regular expression?

721


What are php filters?

716


How to remove white spaces from the beginning and/or the end of a string in php?

767


Why sessions are used in php?

711


What is empty () in php?

729


What are the methods useful for method overloading?

752


Do you know what is the difference between mysql_fetch_object() and mysql_fetch_array()?

736


Which function will suitably replace 'x' if the size of a file needs to be checked? $Size=x(filename);

764


Explain how we can get the number of elements in an array?

736


How can you pass a variable by reference?

761