feikkk Posted January 25, 2009 Report Share Posted January 25, 2009 (edited) Man ir mysql datubāze, kura ir tabula - teksts. No šīs tabulas vajadzētu izvilkt pirmso 50 simbolus, kā to izdarīt? Vai arī pirmos 10 vārdus. Edited January 25, 2009 by feikkk Link to comment Share on other sites More sharing options...
anonīms Posted January 25, 2009 Report Share Posted January 25, 2009 function ShortenText($text) { $chars = 700; // cik burti ievadaa $text = $text." "; $text = substr($text,0,$chars); $text = substr($text,0,strrpos($text,' ')); $text = $text."..."; return $text; } echo ShortenText($rows); Link to comment Share on other sites More sharing options...
bubu Posted January 25, 2009 Report Share Posted January 25, 2009 SELECT SUBSTRING(lauks, 0, 50) FROM tabule Link to comment Share on other sites More sharing options...
Kavacky Posted January 25, 2009 Report Share Posted January 25, 2009 pwnd. Link to comment Share on other sites More sharing options...
feikkk Posted January 25, 2009 Author Report Share Posted January 25, 2009 paldies, tagad viss ir kārtībā. Link to comment Share on other sites More sharing options...
Recommended Posts