I need to break a string into pieces of 2,2,3,3 characters and was able to do this in Perl using decompression:
unpack("A2A2A3A3", 'thisisloremipsum');
However, the same function does not work in PHP, it gives this result:
Array
(
[A2A3A3] => th
)
How to do this using unpacking? I do not want to write a function for it, it should be possible with unpacking, but how?
Thanks in advance,
deniz source
share