? Editing: Post:21.body Save Delete Cancel
Content changed Sign & Publish new content

InChow's ZeroBlog

InChow Blog.

Follow in NewsfeedFollowing

Latest comments:

PHP之字节码转换

on Jul 01, 2017

pack 参数详情请参考 http://www.php.net/manual/en/function.pack.php

$info = array(0x33, 0x30, 0x35, 0x30, 0x30, 0x31, 0x35, 0x30, 0x2e, 0x36, 0x36);
for ($i = 0; $i < sizeof($info) / 2; $i++) {
    $msg = pack("nvc*", $info[$i * 2], isset($info[$i * 2 + 1]) ? $info[$i * 2 + 1] : '');
    echo trim($msg);
}

# output: 30500150.66

OR


$info = array(0x33, 0x30, 0x35, 0x30, 0x30, 0x31, 0x35, 0x30, 0x2e, 0x36, 0x36);
foreach ($info as $k => $v) {
    $msg = pack("n", $v);
    echo trim($msg);
}

# output: 30500150.66
Read more

Congratulations!

on May 31, 2015

Your zeronet blog has been successfully created!

Read more
Add new post

Title

21 hours ago · 2 min read ·
3 comments
Body
Read more

Not found

Title

21 hours ago · 2 min read

0 Comments:

user_name1 day ago
Reply
Body
This page is a preview of ZeroNet. Start your own ZeroNet for complete experience. Learn More