Home >> PHP >> How can find reverse word of string without function in PHP

How can find reverse word of string without function in PHP

$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

Post Your Comment

Next Questions
How can print reverse string and show in array without function
How to insert data from mysql database
How to update data from mysql database
How to delete data from mysql database
How to list data from mysql database
error_reporting
error_reporting(E_ALL)
What is object oriented programming (oops)
What is class
What is object
What is static variable
What is static method
What is constructor
Why use constructor
Predefined constructor
Parameterized constructor
What is destructor
What is Polymorphism
What is Polymorphism types
What is overloading
What is overriding
What is abstraction
What is abstract class
Implementation of abstract method
What is interface

Copyright ©2022 coderraj.com. All Rights Reserved.