method convertUids documentation in bbn\X
Converts a hex UID to a binary UID. You can also give an array or an object to convert the array's items or the object's properties.
Example
X::convertUids('b39e594c261e4bba85f4994bc08657dc');
// (string) b"³žYL&\x1EKº…ô™KÀ†WÜ"
X::convertUids(['b39e594c261e4bba85f4994bc08657dc, 'b39e594c261e4bba85f4994bc08657dc]);
// (array) [b"³žYL&\x1EKº…ô™KÀ†WÜ", b"³žYL&\x1EKº…ô™KÀ†WÜ"]
X::convertUids((object)['uid' => 'b39e594c261e4bba85f4994bc08657dc, 'uid2' => 'b39e594c261e4bba85f4994bc08657dc]);
// (object) {'uid': b"³žYL&\x1EKº…ô™KÀ†WÜ", 'uid2': b"³žYL&\x1EKº…ô™KÀ†WÜ"}
function($st)
{
if (\is_array($st) || \is_object($st)) {
foreach ($st as &$s) {
$s = self::convertUids($s);
}
}
elseif (\bbn\Str::isUid($st)) {
$st = hex2bin($st);
}
return $st;
}
Converts a hex UID to a binary UID. You can also give an array or an object to convert the array's items or the object's properties. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions