write function of the sentence traversal passing the
parameter, e.g input:this is input sentence.
output:sentence input is this.

Answer Posted / vipul dalwala

$input = "this is input sentence";

$array = explode(' ', $input);

$output = implode(' ' , array_reverse($array));

print $output;

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are php errors?

497


What is symfony php?

526


What is magic quotes?

600


How can I use single quotes in single quotes in php?

455


What is the use of mysql_real_escape_string in php?

447






How to find the index of an element in an array php?

521


What is a controller in php?

549


How to use http headers inside php?

564


What does the expression exception::__tostring means?

558


What is the difference between client-side and server-side programming?

533


What is the use of Mbstring?

533


Is php faster than nodejs?

489


When to use single quotes, double quotes, and backticks?

523


How can you execute php script from the command line?

543


What is the use of rand() in php?

603