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
https://forums.phpfreaks.com/topic/246434-wordwrap-problem/
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
https://forums.phpfreaks.com/topic/246434-wordwrap-problem/#findComment-1265694
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.