- substr_replace: documentation ( source)
- implode: documentation ( source)
- dechex: documentation ( source)
- str_pad: documentation ( source)
- str_split: documentation ( source)
- printf: documentation ( source)
<?php
$hash = str_pad(dechex(18583), 8, "0", STR_PAD_LEFT);
$hash = implode(str_split($hash, 2), '/');
$hash2 = substr_replace($hash, 'f', 0, 1);
printf("hash = %s, new hash = %s", $hash, $hash2);