$string="My name is raj";
$str_arr=explode(" ",$string);
for($i=count($str_arr)-1;$i>0;$i--){
echo $str_arr[$i];
}
Output
raj is name my
Coderraj is the global online platform and circle for programmers to learn, communicate, share their knowledge and growth their careers.
Copyright ©2022 coderraj.com. All Rights Reserved.