- var_dump: documentation ( source)
- implode: documentation ( source)
- explode: documentation ( source)
- array_unique: documentation ( source)
- array_fill: documentation ( source)
- ksort: documentation ( source)
<?php
$input = "0-1-1-3-1-1-3-5-0";
$array = explode('-', $input);
$result = array_unique($array) + array_fill(0, count($array), 0);
ksort($result);
var_dump(implode('-',$result));