hi
How to reverse a string without using strrev()

i want the output to be like
Two dogs in the farm

owT sgod ni eht mraf
thank you

Recommended Answers

All 2 Replies

Member Avatar for diafol
$array = explode(" ",$string);
$i=0;
while ($i < count($array){
$array[$i] = strrev($array[$i]);
$i = $i + 1;
}
$string_out = implode(" ",$array);

sorry i have fixed the problem:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.