PHP String Split

Posted by deniz on Stack Overflow See other posts from Stack Overflow or by deniz
Published on 2010-04-08T10:56:11Z Indexed on 2010/04/08 11:03 UTC
Read the original article Hit count: 484

Filed under:
|
|

I need to split a string into chunks of 2,2,3,3 characters and was able to do so in Perl by using unpack:

unpack("A2A2A3A3", 'thisisloremipsum');

However the same function does not work in PHP, it gives this output:

Array
(
    [A2A3A3] => th
)

How can I do this by using unpack? I don't want to write a function for it, it should be possible with unpack but how?

Thanks in advance,

© Stack Overflow or respective owner

Related posts about php

Related posts about split