Ads removed from the pastie. \o/
Running costs stayed. :-(
Donations welcome!
Bitcoin: |
1QC38uPBSy7WSYz1whM5SYTHAdhqkN6o8V |
Ethereum: |
0x0855778a6181a69cc7d5d08c71c4f5846010eb67 |
Litecoin: |
LbgSLsAbgbZBU2Ksg4vwuKHK8dAbJESi49 |
Verge: |
D8fo1fszrNmUK4kfQW5owhYMv3osPvgn2g |
Paste ID: |
# jd2Nc |
Date posted: |
Tue, 10 Apr 2012 00:11:46 +0000 |
Date of expiration: |
never (permanent entry) |
Description: |
Convert hex to string or string to hex |
<?php
/**Converts hex into ascii string.
*/
function hex2str( $hex )
{
}
// Example:
hex2str( "\x3c\x62\x3e\x48\x65\x6c\x6c\x6f\x2c\x20\x57\x6f\x72\x6c\x64\x21\x3c\x2f\x62\x3e" );
/**Converts a string into hex.
*/
function str2hex( $str )
{
}
// Example:
str2hex( '<b>Hello, World!</b>' );
?>