Split pages into two halves

Discussion in 'PHP' started by Astroman, Aug 11, 2009.

  1. Astroman

    Astroman Well-Known Member

    Messages:
    2,355
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    135
    #21
    Never mind, I was just being a tard. I understand now. :)

    I did this and it works (if anyone else reads this you will have to change the '$this->item->text' to whatever is used in your code to display your content):

    <?php
    $advertise = '<img src="images/logo.jpg" width="333" height="70" alt="Logo" />';
    $page = $this->item->text;
    preg_match('#((?:\S+\s+){260})(.*)#s', $page, $matches);
    $header = $matches[1];
    $main = $matches[2];
    
    echo $header;
    echo $advertise;
    echo $main;
    
    ?>
    Code (markup):
     
    Last edited: Sep 9, 2009
    Astroman, Sep 9, 2009 IP