strong-storm Posted March 5, 2005 Report Posted March 5, 2005 scripts: $result = mysql_query("SELECT * FROM `book` ORDER BY `date` DESC"); while ($row = mysql_fetch_array($result)) { $id = $row["id"]; echo $id ."."; } skripts attēlo sekojoši 1.2.3.4.5. bet kā likt nodzēst to pēdējo punktu?
Kavacky Posted March 5, 2005 Report Posted March 5, 2005 Pārbaudi, vai nav pēdējais elements masīvā. Ja nav, tad liek punktu. Ja ir, tad neliek.
kirils Posted March 5, 2005 Report Posted March 5, 2005 raxti shitaa: $result = mysql_query("SELECT * FROM `book` ORDER BY `date` DESC"); while ($row = mysql_fetch_array($result)) { $id[] = $row["id"]; } echo implode('.',$id);
Klez Posted March 6, 2005 Report Posted March 6, 2005 $result = mysql_query("SELECT * FROM `book` ORDER BY `date` DESC"); $cik = mysql_num_rows($result); $p = 0; while ($row = mysql_fetch_array($result)) { $p++; echo $id = $row["id"]; if ($cik != $p) echo "."; }
Analgiins Posted March 7, 2005 Report Posted March 7, 2005 iisteniibaa shitaadas lietas daraas taa: rtrim ($text, ".")
Recommended Posts