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 api laravel?

532


Tell me what is the use of "ksort" in php?

559


What is the special meaning of __sleep and __wakeup?

573


Why should I learn php?

516


What are the characteristics of php?

571






Why many companies are switching their current business language to php?

594


How many escape sequences are recognized in double-quoted strings?

546


What is the difference between array_pop() and array_push()?

631


How to delete cookie files on your computer?

555


What are the Advantages and Application Areas of PHP?

515


Which Scripting Engine PHP uses?

564


How to get ip address of a server in php?

553


How to create a mysql connection in php?

529


What are different types of errors available in Php?

498


What do you mean by core php?

491