Ajay Pratap Singh Ajay Pratap Singh - 1 year ago 89
PHP Question

Place space or dash between number

I have number

I want to place - between two number till my given number count would not be end.

$nubmer = 1234567890.

output will be

Answer Source
function splitNum($num) {
  return implode("-", str_split($num, 2));
echo splitNum("1234567890") //output: 12-34-56-78-90 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download