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
Does https prevent csrf?
What does the scope of variables mean?
What is stripslashes php?
How can we calculate the similarity between two strings?
Is php good for career?
How to find the position of the first occurrence of a substring in a string?
What is the function mysql_pconnect() useful for?
Explain the difference between require() and require_once()?
How can I use single quotes in single quotes in php?
What does a delimiter do in mysql?
What is prepare in php?
Which operator is used to concatenate two strings in PHP?
What's the output of the ucwords function in this example?
What is difference between print_r and echo in php?
What is cookie and why do we use it?