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