reorder elements in a string

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pgolovko
Forum Commoner
Posts: 38
Joined: Sun Sep 17, 2006 9:13 am

reorder elements in a string

Post by pgolovko »

Code: Select all

$my_string = "/main/category/sub/one_more_sub/";

// I need to reverse this string into:
$my_new_string = "/one_more_sub/sub/category/main/";

// whould it be possible? If so, then how?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Post Reply