<?php

 function strInv ($string) {

 	$str_inv = '' ; 

	 for ($i=0,$s=count($string);$i<$s;$i++){
	 	$str_inv .= implode(' ',array_reverse(explode(' ',$string[$i])));
	 	$str_inv .= '<br>';
	 }

 	return $str_inv;

 }

 $string[] =  ;
 $string[] =  ;
 $string[] =  ;
 $string[] =  ;
 $string[] =  ;
 $string[] =  ;
 $string[] =  ;
 $string[] =  ;
 $string[] =  ;
 $string[] =  ;


echo strInv($string);