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

How can cross site request forgery csrf be prevented?

0 Answers  


Explain what is smarty?

0 Answers  


Applications written to provide a GUI shell for Unix and Linux are called

0 Answers  


What's the difference between using mysql_ functions and pdo?

0 Answers  


What is magic function in php?

0 Answers  






What are php strings?

0 Answers  


Name and explain five of the PHP error constants?

0 Answers  


Can I include php in javascript?

0 Answers  


What is $_ request in php?

0 Answers  


How we can get the number of elements in an array?

0 Answers  


Tell me can you extend a final defined class?

0 Answers  


Tell me what is the definition of a session?

0 Answers  


Categories