Home  >  Article  >  Backend Development  >  php用于编码和解码的函数有哪些?

php用于编码和解码的函数有哪些?

PHPz
PHPzOriginal
2016-06-13 11:51:151426browse

php用于编码和解码的函数有哪些?

php用于编码和解码的函数

URL:

  • urlencode(); //编码

  • urldecode(); //解码

URL与数组互转:

  • parse_url ()

  • http_build_query()

base64:

  • base64_encode();

  • base64_decode();

JSON:

  • json_encode();

  • json_decode();

SESSION:

  • session_encode();

  • session_decode();

字符转为HTML实体:

  • htmlentities()  / html_entity_decode()

    所有字符转换为 HTML 实体

  • htmlspecialchars()  / htmlspecialchars_decode()

    将特殊字符"<" (小于)和 ">" (大于)转换为 HTML 实体 

uuencode编码:

  • convert_uuencode();

  • convert_uudecode();

字符集编码相互转换:

  • iconv(); 

  • mb_convert_encoding();

更多相关知识,请访问 PHP中文网!!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn