Thank you guys! Phil, I will try your last example. That should be ok!

Arnaud

10-22-2009, 08:44 AM

Re-thinking about it made me come to another solution, which actually seems quicker and easier. I used strrev to reverse the number, then preg_split to separate the number in single pieces, then a simple foreach combined with an IF statement to add the spaces. Works fine like that and it actually also works for smaller numbers.

good to here it. The i was under the impression that you would not know the string length. With my above post, the input could be any length and the patten would still continue. But, glad you sorted it, it kept me amused for an hour :-)