- str_repeat: documentation ( source)
- array_merge: documentation ( source)
- array_values: documentation ( source)
- unpack: documentation ( source)
- sprintf: documentation ( source)
<?php
function getFormattedData() {
$data = '@@';
return call_user_func_array(
'sprintf',
array_merge(
array(str_repeat('%08b', strlen($data))),
array_values(unpack('C*', $data))
)
);
}
echo getFormattedData();