Reformatting The Content Of A File
===

I have a file called "data.txt". In this file, there are 30 lines with strings who all have the same length. It looks like this:

    2QA4ZRDUT
    IDVLTLZSC
    4GYC3HCMV
    1W6409JD5
    70P7U66TE

... and so on.

What I want to do now is reformatting these lines. I want 5 strings on one line, seperated with a ";". After that, I want a new line and the next 5. In the end, it should look like this:

    2QA4ZRDUT;IDVLTLZSC;4GYC3HCMV;1W6409JD5;70P7U66TE;
    NGN1TGF6G;JWVI7LSIZ;U99TMVXXK;KLBDMRPQV;MEFKLUO3;

... and so on, until the whole content of the file is reformatted like this.

The last hours I've been trying to accomplish this by using for, foreach and while loops but I only manage to get one line. I hope somebody can help me since I'm not that experienced with PHP.

This is the content of "data.txt":

    2QA4ZRDUT
    IDVLTLZSC
    4GYC3HCMV
    1W6409JD5
    70P7U66TE
    OG2JBBZF6
    5391PHOVW
    ZAJ3OZ4H2
    GMOB9E9X7
    Q8U4C8ZK1
    0WDZLRWWJ
    N487W3S24
    PKXQFFEK3
    NSMKC29IB
    HOLI1T2ZB
    DVPIVLLLS
    FH7RSZWTM
    9VSUWPZEX
    NM6ZWV19I
    NGN1TGF6G
    JWVI7LSIZ
    U99TMVXXK
    KLBDMRPQV
    MEFKLUO3L
    LICFIK24W
    ELGPLCK51
    QQS4SOJV1
    KJ2UVTU1B
    FLQ6T7LG6
    QJZLAPYN1