Jump to content

how to reverse numbers ?

- - - - -

  • Please log in to reply
2 replies to this topic

#1
lol33d

lol33d

    Programmer

  • Members
  • PipPipPipPip
  • 149 posts
hi guys

i need reverse/change numbers

for example

$n = "(1-0) 1-5"
change to
(0-1) 5-1

how to this?

thanks

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
I'd use a regex to incrementally extract the numbers, then rebuild the string.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
lol33d

lol33d

    Programmer

  • Members
  • PipPipPipPip
  • 149 posts
thank you

i use PHP: strrev - Manual and solved




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users