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



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

Answer / 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

More PHP Interview Questions

What is the array in php?

0 Answers  


How do http requests work?

0 Answers  


What is isset function in php?

0 Answers  


how we can crop an image and how we can display it..

1 Answers   Satyam,


How do I know my xampp version?

0 Answers  






Why do we show php code in browser?

0 Answers  


What is the difference between for and foreach?

0 Answers  


What is trim codeigniter?

0 Answers  


Why delimiter is used in mysql?

0 Answers  


How is the comparison of objects done in php?

0 Answers  


How to check an key is exists in array?

0 Answers  


What is the use of $_request variable?

0 Answers  


Categories