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

Answer Posted / dheeraj

Use explode()just notice the following code. here it splits
a string to parts and forms an array. Now u assign the array
element to a string.

<?php
$str = "Hello world. It's a beautiful day.";
print_r (explode(" ",$str));
?>

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is php routing?

512


How to get the number of characters in a string?

567


Which function is used in php to delete a file?

557


How do you define a constant in php?

555


What are the disadvantages of php?

510






How can you execute php script from the command line?

545


Explain me how failures in execution are handled with include() and require() functions?

608


Explain me differences between get and post methods?

563


How to redirect https to http url and vice versa in .htaccess?

515


What is a PHP Filter?

612


What are the characteristics of php?

560


How do you call a constructor for a parent class?

507


Explain a resource?

610


What is htmlentities function in php?

507


What is the capacity of mysql database?

563