[ create a new paste ] login | about

Link: http://codepad.org/XGyVQ1hk    [ raw code | output | fork ]

jacobrelkin - PHP, pasted on Dec 12:
1
2
3
4
5
6
7
8
9
10
<?php

function replaceCharsInNumber($num, $chars) {
   return substr((string) $num, 0, -strlen($chars)) . $chars;
}

$number = 5069695;
echo replaceCharsInNumber($number, 'xxx'); //5069xxx

?>


Output:
1
5069xxx


Create a new paste based on this one


Comments: