fork(9) download
  1. <?php
  2.  
  3. $guid = '{4BD8D571-6D19-48D3-BE97-422220080E43}';
  4.  
  5. $p = '#{?([0-9A-F]{8})-'.
  6. '([0-9A-F]{4})-'.
  7. '([0-9A-F]{4})-'.
  8. '([0-9A-F]{2})([0-9A-F]{2})-'.
  9. '([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})}?#';
  10. preg_match($p, strtoupper($guid), $m);
  11. echo sprintf('0x%s,0x%s%s,0x%s%s%s%s,0x%s%s%s%s',
  12. $m[1],
  13. $m[3], $m[2],
  14. $m[7], $m[6], $m[5], $m[4],
  15. $m[11], $m[10], $m[9], $m[8]);
  16.  
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
0x4BD8D571,0x48D36D19,0x224297BE,0x430E0820