Jump to content
GIGN Forum

Teksta Sagriešana


RaaapuLis
 Share

Recommended Posts

jap no mysql

$result=mysql_query("SELECT id, raksta_id, niks, komentaars, datums FROM komentaari"); while($row = mysql_fetch_array($result, MYSQL_NUM))

		{

		echo "
		<table style='padding:2px' border='1' cellspacing='0' cellpadding='5'> 
<tr> 
<td>$row[0]</td> 
<td>$row[1]</td> 
<td>$row[2]</td> 
<td>$row[3]</td>
</tr> 

</table>";

Link to comment
Share on other sites

sry pa dubultpostu bet paņem vnk šo funkciju:

function CropSentence ($strText, $intLength, $strTrail) 
{
    $wsCount = 0;
    $intTempSize = 0;
    $intTotalLen = 0;
    $intLength = $intLength - strlen($strTrail);
    $strTemp = "";

    if (strlen($strText) > $intLength) {
        $arrTemp = explode(" ", $strText);
        foreach ($arrTemp as $x) {
            if (strlen($strTemp) <= $intLength) $strTemp .= " " . $x;
        }
        $CropSentence = $strTemp . $strTrail;
    } else {
        $CropSentence = $strText;
    }

    return $CropSentence;
}

$strTemp = "Hello, I am a fish and you are not.";
$strTemp = CropSentence($strTemp, 16, "..."); 
print $strTemp;
?>

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...