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 cookie in php with example?

710


How to remove the new line character from the end of a text line in php?

760


What is api example?

754


How to initiate a session in php?

896


Is a number php?

758


How can I make a script that can be bilingual (supports english, german)?

815


Is php fully object oriented?

681


What is the use of 'print' in php?

808


What is the use of header() function in php?

769


What is csrf token in php?

815


What is the purpose of constant() function?

750


What is the importance of parser in php?

848


What is $_ get?

750


Do you know how to get the ip address of the client?

770


Which will start a session?

769