- substr: documentation ( source)
- strtoupper: documentation ( source)
- dechex: documentation ( source)
- ord: documentation ( source)
<?php
function strToHex($string){
$hex = '';
for ($i=0; $i<strlen($string); $i++){
$ord = ord($string[$i]);
$hexCode = dechex($ord);
$hex .= substr('0'.$hexCode, -2);
}
return strToUpper($hex);
}
echo strToHex('The MyThemeShop Updater plugin is required for this theme.');
echo "\n";
echo strToHex('You need to <a href="[plugin_url]">connect with your MyThemeShop account</a> to use the current theme.');
echo "\n";
echo strToHex('Connect now');