tomchesley
Technical User
I am trying to convert a numerical string to its hex equivelent.
Say for instance
if $u = "1"
i want $h = "01"
if $u = "10"
$h = "0a"
and so on
The $u will never go above 255
There ha to be a better way
at moment i have
Say for instance
if $u = "1"
i want $h = "01"
if $u = "10"
$h = "0a"
and so on
The $u will never go above 255
There ha to be a better way
at moment i have
Code:
if ($u < 10) {
$h = "0".$h;
}
if ($u == 10) {
$h = "0a";
}
.
.
if ($u == 16) {
$h = 10;
}