Convert a Perl code to PHP

前端 未结 8 1504
粉色の甜心
粉色の甜心 2021-01-29 08:50

I need to convert the following perl function to php:

pack(\"SSA12AC4L\",
     $id,
     $loc,
     $name,
     \'ar\',
     split(/\\./, $get->getIP),
     t         


        
8条回答
  •  日久生厌
    2021-01-29 09:43

    From the PHP documentation for pack().

    Pack given arguments into binary string according to format.

    The idea for this function was taken from Perl and all formatting codes work the same as in Perl. However, there are some formatting codes that are missing such as Perl's "u" format code.

    Surely it should just work as is? You may need to rename some variables

提交回复
热议问题