简体   繁体   English

如何在php中将十六进制值转换为字母字符串

[英]How to convert hex value to alphabetic string in php

有没有办法获取特定十六进制值的字母字符串?

You can use hex2bin to convert hex: 您可以使用hex2bin转换十六进制:

$string = hex2bin($hex);

If you want to remove any non-alpha character from $string you can use a regular expression to remove anything that's not az or AZ: 如果要从$string删除任何非字母字符,则可以使用正则表达式删除非z或AZ的任何内容:

$alpha_only = preg_replace("/[^a-zA-Z]+/", '', $string);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM