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 to display your correct URL of the current web page?

0 Answers  


How long is csrf token?

0 Answers  


How does api connect to database?

0 Answers  


Which is better php or nodejs?

0 Answers  


What are the differences between GET and POST methods in form submitting?

0 Answers  


What is php session_start() and session_destroy() function?

0 Answers  


Is php a float?

0 Answers  


What is the difference between mysql_fetch_array() and mysql_fetch_assoc()?

0 Answers  


explain php variable length argument function.

0 Answers  


How to get ip address of a server in php?

0 Answers  


List some of the features of php7.

0 Answers  


If there are 10 text boxes in a form having same name, their value are different. Value of which textbox will be received on action script?

20 Answers   A1 Technology, Bajaj, DG, Genpact,


Categories