Dvielis Posted March 8, 2006 Report Share Posted March 8, 2006 lieta taada, piem datuve.lv vai boot.lv kad ir posts, tur paraadaas paaris rindinjas un tad links ar uzraxtu Lasīt tālāk ... nu es uzmociiju kauko liidziigu - $text = substr($text,0,500); bet kaa panaakt, lai vinsh nelasa peec simbooliem, bet tad kad man postaa ir enteris, tad lai vinsh peec taa entera man paraada Lasiit taalaak nevis peec 500 simboliem ... Link to comment Share on other sites More sharing options...
bubu Posted March 8, 2006 Report Share Posted March 8, 2006 strpos un substr: echo substr($text . "\n", strlen($text, "\n")); Link to comment Share on other sites More sharing options...
Dvielis Posted March 8, 2006 Author Report Share Posted March 8, 2006 nee, es biju domaajis, lai vinsh man titullapaa raada nevis visu postu, bet gan tikai tik daudz liidz saakas jauna rindkopa ... titullapaa man paraadaas posta pirmaa rindkopa, un tad spiezhu taalaak kur es varu izlasiit paareejo dalju ... nevaru nekaadi izdomaat kaa lai panaak to lai vinsh saprot ka peec pirmaas rindkopas neko vairaak nevajag raadiit titullapaa ... var jau taisiit atsevishkju ievades lauku, kur kjipa es noraadu posta ievadu ... bet iedomaajos ka var arii bez taa iztikt mok ... Link to comment Share on other sites More sharing options...
bubu Posted March 8, 2006 Report Share Posted March 8, 2006 Nu tak lol. Mana rindiņa tieši to jau arī dara - izvada pirmo rindkopu - tekstu līdz pirmajam enter (vai visu tekstu, ja nav enteru tavā tekstā). Link to comment Share on other sites More sharing options...
Dvielis Posted March 8, 2006 Author Report Share Posted March 8, 2006 jap, aizgaaja gan tomeer.. uzliku - shitaa: $text = substr($apraksts . "\n", strlen($text, "\n"), strpos($text, "\n")); bubu: tnx :) Link to comment Share on other sites More sharing options...
bubu Posted March 8, 2006 Report Share Posted March 8, 2006 Ui, sajaucu substr parametrus.. Tā ir ka sen nav php darīts. Šitā vajag: $text = substr($text . "\n", 0, strpos($text, "\n")); Tavā variantā vispār nav labi strlen() likt divus parametrus. Tai fjai ir tikai viens parametrs tak! (tu dokumentāciju vispār pamēģini kādreiz atšķirt) Link to comment Share on other sites More sharing options...
Recommended Posts