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