常用工具: 简繁转换 HTML/JS互转 Url编码Escape解析 Unicode编码转换 设为首页 加入收藏夹
更多内容
" id="arctext" class="center" " class="arcinfo center" " id="slistl" class="left" " id="mid_slistl_sch" class="left" " id="mid_slistl_adv" class="left" " id="mid_slistl_adv2" " src="http://www.fzs8.net/d/js/acmsd/middle2.js"
文章正文

ASP Hex 函数

来源:  网络收集  字体:[ ]
站内搜索系统
文章正文

php bin2hex() 函数

来源:  网络收集  2006-10-11 00:00:00 字体:[ ]

Definition and Usage
定义和用法

The bin2hex() function converts a string of ASCII characters to hexadecimal values. The string can be converted back using the pack() function.
bin2hex()函数的作用是:将二进制数据转换成十六进制表示。同时,如果需要转换回原来的进制,那么可以使用pack()函数。

Syntax
语法

bin2hex(string)

Parameter参数 Description描述
string Required. The string to be converted
必要参数。指定需要转换的字符串


Example
案例

In this example we will convert a string value from binary to hex and back:
在下面的案例中,我们将把一个字符串的值从2进制转换成16进制:

<?php$str = "Hello world!";echo bin2hex($str) . "<br />";echo pack("H*",bin2hex($str)) . "<br />";?>

The output of the code above will be:
上述代码将输出下面的结果:

48656c6c6f20776f726c6421Hello world!


  
上一篇:php addslashes() 函数
下一篇:php chop() 函数
最新文章
推荐文章
热门文章
版权所有:IT加油站   COPYRIGHT © 2007 WWW.FZS8.NET ALL RIGHTS RESERVED.
闽ICP备08008535号