<?php
$string = '<:header>HEADER</header><:main>MAIN<:item>ITEM</item></main>';
// passo 1
// passo 2
// passo 3
PD9waHAKCgkkc3RyaW5nID0gJzw6aGVhZGVyPkhFQURFUjwvaGVhZGVyPjw6bWFpbj5NQUlOPDppdGVtPklURU08L2l0ZW0+PC9tYWluPic7CgogICAgLy8gcGFzc28gMQogICAgJHN0cmluZyA9IHByZWdfcmVwbGFjZSggJy88Lio/Pi8nICwgJ3wnICwgJHN0cmluZyApOwoKICAgIC8vIHBhc3NvIDIKICAgICRzdHJpbmcgPSBwcmVnX3JlcGxhY2UoJy9cfCsvJywgJ3wnLCAkc3RyaW5nKTsKCiAgICAvLyBwYXNzbyAzCiAgICAkc3RyaW5nID0gYXJyYXlfZmlsdGVyKCBleHBsb2RlKCAnfCcgLCAkc3RyaW5nICkgKTsKCnByaW50X3IoICRzdHJpbmcgKTs=