Recent Changes - Search:

PmWiki

pmwiki.org

edit SideBar

PHP-Tips

Wordwrap

<?php
$text = "A very long woooooooooooord.";
$newtext = wordwrap($text, 8, "\n", 1);

echo "$newtext\n";
?>
This example would display:

A very
long
wooooooo
ooooord.


The $newstring part returns only the text from BEFORE the quotes. In this case a new line, so only the first line is returned.

$newtext = wordwrap($description, 100, "\n", 1);
$newstring = substr($newtext, 0, strpos($newtext, "\n"));

   		<td colspan="2" style="color:red"><b>Issue Reference:
                   <a href="hsl:hotissue?issueref=<?echo $issueref;?>"><?echo $issueref;?></a>


                     <?echo $newstring ?> </b>
                   <?echo "</b><br><PRE> ".$newtext;"</PRE>" ?></td>


PHP and managing a string from a DB

echo sprintf("%02s%02s%02s%02s", substr($call_logdate,3,3),substr($call_logdate,0,2),substr($call_logdate,5,5),substr($call_logdate,10,18));

Edit - History - Print - Recent Changes - Search
Page last modified on July 11, 2007, at 05:12 PM