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

How to remove duplicate values from array using php?

529


How we can get the number of elements in an array?

8407


What are include() and require() functions?

523


How do I get csrf token?

560


In PHP, fgets() is used to read a file one line at a time. State Whether True or False?

587






What's the difference between accessing a class method via -> and via ::?

534


Describe PHP error and logging information?

545


Why do we use cookie?

552


What is variable function php?

560


Binary tree question - Node has numeric data (int) The function takes depth as argument and sum all the value of the node of the depth. For instance, (0) depth 0 / \ 10 20 depth 1 / \ / \ 40 50 60 70 depth 2 so if you pass get_sum(2), you would return 220 which is 40+50+60+70 (sum of depth2) write the function.

1513


What are the benefits of using queries?

517


What is needed to be able to use image function?

528


What PHP stands for?

572


What are the final class and final method?

536


Why do we use session?

540