echo bin2hex($string);
or:
for ($i = 0; $i < strlen($string); $i++) {
echo str_pad(dechex(ord($string[$i])), 2, '0', STR_PAD_LEFT);
}
$string
is the variable which contains input.
More Related Contents:
- How to replace Microsoft-encoded quotes in PHP
- Detect encoding and make everything UTF-8
- PHP output showing little black diamonds with a question mark
- Setting the PHP default encoding to UTF-8
- PHP convert string to hex and hex to string
- how to replace special characters with the ones they’re based on in PHP?
- Error: “Input is not proper UTF-8, indicate encoding !” using PHP’s simplexml_load_string
- converting a number base 10 to base 62 (a-zA-Z0-9)
- PHP messing with HTML Charset Encoding
- How can I combine two strings together in PHP?
- How do I remove  from the beginning of a file?
- Make all words lowercase and the first letter of each word uppercase
- Array to String PHP?
- UTF-8 BOM signature in PHP files
- php implode (101) with quotes
- Question about strpos: how to get 2nd occurrence of a string?
- Single quotes or double quotes for variable concatenation? [closed]
- Str_replace for multiple items
- MySQL db question marks instead of hebrew characters..?
- How to handle double quotes in string before XPath evaluation?
- Escape string to use in mail()
- How can I split a string in PHP at the nth occurrence of a needle?
- Getting the first character of a string with $str[0]
- PHP E-Mail Encoding?
- What does the b in front of string literals do?
- Search and replace multiple values with multiple/different values in PHP5?
- Generating a random hex color code with PHP
- How to separate letters and digits from a string in php
- How does PHP compare strings with comparison operators?
- Ensuring valid UTF-8 in PHP