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

Write a php script to get the largest key in an array?

706


write a prog using insert,update,delete in this manner as output? name: phno. add button 1.name phno. edit button delete button 2.

1747


How to Retrieve the Session ID of the Current Session?

688


How can you create a session in php?

676


What is form validation in php?

701






Why do we use hooks?

659


How to create a text file in PHP?

808


How do I clear my browser session?

720


What is preg_match?

699


Why does php need server?

689


Name some of the functions in php.

660


Why do we use polymorphism in php?

715


Why php language is used?

686


What are the rules in creating php variable?

691


Is jquery better than javascript?

713