webForumDet fria alternativet

Ännu ett problem

1 svar · 135 visningar · startad av UrMe

UrMeMedlem sedan apr. 2001762 inlägg
#1

Denna kod har jag fått:

<?php
$str= " Bla bla balb al ksad  kajshd akueh aksjdh akueh kashd aushdkh aksjhd ";     //The string 
$no_of_words = 7;                                        // no. of words to appear 
$str_array = split( " ",$str,$no_of_words+1);             // split strings into array element 
   if(count($str_array)>$no_of_words) {                     // check no of words from original string 
     for($i=0; $i < $no_of_words; $i++) {             // if it is longer than what we want,  
             print $str_array[$i]. " "; }              //       print word by word 
             print  "<b>...........(more)</b>";}               //       print ..... 
   else {                                                   // otherwise 
     print $str; }

?>

men jag vill hämta texten från en databas ... vad ska jag skriva i
$str = " asdlkj alksjd "; ?
jag har testat allt möjligt som echo($row["text"]) .. etc.. men den säger bara:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home2....

vad gör jag för fel?

------------------
You play by the rules, you die by the rules

UrMeMedlem sedan apr. 2001762 inlägg
#2

Jippie.. jag löste det själv.. tack ändå :)

------------------
You play by the rules, you die by the rules

129 ms totalt · 3 externa anrop · v20260731065814-full.86db40fa
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
127 ms — hämta tråd, inlägg och bilagor (db)