http://php.net/manual/en/function.strcmp.php ?
PHP kôd:
$string1 = "ÿþýü";
$string2 = "ÿþýü";
echo strcmp($string, $string2); // 0
0 znači da su identični
Što se tiče hexdec, imaš temu juče otvorena...
Preg_replace by jablan
PHP kôd:
$string = "!\"#$%&'()";
$hex = preg_replace("/(.)/es", "sprintf(' %02X', ord(stripslashes('$1')))", $string);
echo $hex;
by me...
PHP kôd:
$string = "!\"#$%&'()";
function strhex($string){
for($i = 0; $i < strlen($string); $i++){
$hex = unpack('H*', substr($string, $i, 1));
$return .= $hex[1]." ";
}
return $return;
}
echo strhex($string); // 21 22 23 24 25 26 27 28 29
Ova moja funkcija vraća "c3 bc", za umlaut odnosno 252 karakter.