php pack的疑惑

WBOY
Release: 2016-06-06 20:15:48
Original
1219 people have browsed it

就拿着行代码来说
pack("A20", "中国强大");
他的意义是什么, "中国强大"在内存中本身就是用ascii编码表示的,那pack到底干了什么事情.不太理解.

回复内容:

就拿着行代码来说
pack("A20", "中国强大");
他的意义是什么, "中国强大"在内存中本身就是用ascii编码表示的,那pack到底干了什么事情.不太理解.

摘自手册:http://php.net/manual/zh/function.pack.php

A SPACE-padded string

从右向左填充空格,凑足20个字符。
与str_pad("中国强大", 20)功能类似。

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!