Jump to content

wordwrap problem


dean91

Recommended Posts

Okay so I am trying to built a little script that displays buttons on a page but when more buttons are added they carry on across the page.

 

I need them to linebreak after say 5 buttons but nothing seems to work

 

this is the code

 

$url      = ($settings['clean'] == 0) ? $url : 'go.php?url='.rawurlencode($url);
            $nofollow = $settings['use_nofollow'] ? 'rel="nofollow"' : '';
$newurl = wordwrap($url, 20, "<br />\n");

            echo '
            
            
            <td class="showtag"><a href="'.$newurl.'" target="_blank" class="large blue button" '.$nofollow.'>'.$title.'</a>'.$show_url.'<br>'.'</td>

Link to comment
Share on other sites

 

 

The buttons are echoed but they carry on across the page when if the page was static HTML I would add a </ br> tag after like 5-6 buttons so it does not break the page.

 

This is how it is (It breaks the page): button button button button button button button button button button

 

I need it like this:

 

button button button button button </ br>

button button button button button </ br>

 

I need to find a way of adding a </ br> after every 5 buttons so the page displays correctly. :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.