- substr: documentation ( source)
- strtoupper: documentation ( source)
<?php
$uniqueId = '123456789';
$guid = substr($uniqueId,0,8)."-".
substr($uniqueId,8,4)."-".
substr($uniqueId,12,4)."-".
substr($uniqueId,16,4)."-".
substr($uniqueId,20,12);
return strtoupper($guid);