Probably a simple problem if you know the answer.
What I have
Numbers with no spaces.
$str = 10000;
$str2 = 100000;
What I want
Convert above to below...
$str = '10 000';
$str2 = '100 000';
Own thoughts
I thought of some strpos, regexp, str_replace but is it really the way to solve this? I will accept the most correct, short code answer with no lack of speed.