Quote
echo getCaseField('AronSchatz', '0') . "\n";
echo getCaseFieldRev('AronSchatz', '0') . "\n";
function getCaseField($tword, $padding) {
$result = "";
for ($i = 0; $i < strlen($tword); $i++) {
$result .= (substr($tword, $i, 1) == strtolower(substr($tword, $i, 1)) ? '0' : '1');
}
return str_pad($result, 32, $padding, STR_PAD_LEFT);
}
function getCaseFieldRev($tword, $padding) {
return strrev(getCaseField($tword, $padding));
}