Profile

Cover photo
Vuthy Sok
342 followers|10,731 views
AboutPostsPhotosVideos

Stream

Vuthy Sok

Shared publicly  - 
1
Add a comment...

Vuthy Sok

Shared publicly  - 
1
Add a comment...

Vuthy Sok

Shared publicly  - 
 
Javascript random number between two numbers
function getRandomInt(min, max) {
  return Math.floor(Math.random() * (max - min)) + min;
}

console.log(getRandomInt(1,100));
1
Add a comment...

Vuthy Sok

Shared publicly  - 
 
Javascript display numbers with commas
function commaSeparated(val){     while (/(\d+)(\d{3})/.test(val.toString())){       val = val.toString().replace(/(\d+)(\d{3})/, '$1'+','+'$2');     }     return val; } // Call Function console.log(commaSeparated(1)); // 1 console.log(commaSeparated(10)); ...
1
Add a comment...

Vuthy Sok

Shared publicly  - 
 
PHP: show a comma on all value except last value from mysql_fetch_array
$count = 0;
while ($servdescarrayrow = mysql_fetch_array($servdescarray)) {
if ($count++ > 0) echo ",";
echo $servdescarrayrow['serv_desc'];
}
1
Add a comment...

Vuthy Sok

Shared publicly  - 
 
PHP: Prepend leading zero before single digit number
It will only add the zero if it's less than the required number of characters. When working with numbers, you should use %d (rather than %s ), especially when there is the potential for negative numbers. If you're only using positive numbers, either option ...
1
Add a comment...
People
In his circles
25 people
Have him in circles
342 people
Borinn Ourng's profile photo
Pang Sovanarith's profile photo
Sok Borwath's profile photo
Vichet Sen's profile photo
Sorya Chiem's profile photo
Sreypov barbie's profile photo
Rachel Sean's profile photo
Hel Mea's profile photo
VuthVuth KEO Comedy Plus's profile photo
Links
Basic Information
Gender
Male