Return to Snippet

Revision: 51618
at September 29, 2011 18:32 by dhjapan


Updated Code
// Get number
// Returns spaced string between Ks
// ex : 14563 -> 14 563
function spaceKs($n)
{
	if (strlen($n)>3) return substr($n, 0, -3). " " . substr($n, -3);
	else return $n;
}

Revision: 51617
at September 29, 2011 18:31 by dhjapan


Initial Code
function spaceKs($n)
{
	if (strlen($n)>3) return substr($n, 0, -3). " " . substr($n, -3);
	else return $n;
}

Initial URL

                                

Initial Description
Get number and returns a spaced string (14563 -> 14 563)

Initial Title
Add spaces between K\'s in a number

Initial Tags
php

Initial Language
PHP