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

Is php session id unique?

0 Answers  


Which function is used to read a file removing the html and php tags in it upwork?

0 Answers  


What is the role of the .htaccess file in php?

0 Answers  


Explain how to run the interactive php shell from the command line interface?

0 Answers  


What is the use of anonymous function in php?

0 Answers  


What is meant by ‘passing the variable by value and reference' in php?

0 Answers  


What is better .net or php?

0 Answers  


how we can retrive data in pdf along php mysql?

2 Answers  


What is the difference between the functions strstr() and stristr()?

0 Answers  


How to remove a file?

0 Answers  


How to turn on the session support?

0 Answers  


What the difference between the 'bitwise and' operator and the 'logical and' operator?

0 Answers  


Categories