PHP - Wordwrap
Is there way in php to do thsi: I get news title from msql and if it to long to break it in two spans, to get
Code: [Select] <h2> <span>Show unread posts since</span> <span>last visit.</span> </h2> from this Code: [Select] <h2> <span>Show unread posts since last visit.</span> </h2> So, if is h2 weight 100px to break up in two spans whats out of that 100px. Similar TutorialsOkay 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 Code: [Select] $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> This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=308022.0 I want to limit the length of an author's name in a display to 10 characters - using two lines if necessary for full display. I know I can use wordwrap of some sort to do that. However, I am not sure where/how to accomplish it. Can it be inserted in the following (and if so, where/what do I insert, specifically): Code: [Select] <?php _e('Order by','authors') ?>:<br /> <label for="authors-order-<?php echo $number; ?>-name"><input type="radio" class="radio" id="authors-order-<?php echo $number; ?>-name" name="widget-authors[<?php echo $number; ?>][order]" value="name"<?php echo 'name' == $order || '' == $order ? ' checked="checked"' : '' ?> /> <?php _e('Display name','authors' ) ?></label> NOTE: I have attached the full code in a text file if I've selected the wrong snip. Thank you! [attachment deleted by admin] |