son Posted December 1, 2008 Share Posted December 1, 2008 Is there a way to store several sentences separated by comma in a one db table field (maybe type text) and then have the php page which displays db data interpret the text as an array (separated with the comma) to be displayed as list items? I am looking for a way of easily enter a list which belongs to a certain page. Son Link to comment Share on other sites More sharing options...
Ingolme Posted December 1, 2008 Share Posted December 1, 2008 There's a function called explode() that does that. Link to comment Share on other sites More sharing options...
son Posted December 2, 2008 Author Share Posted December 2, 2008 There's a function called explode() that does that.Ingolme,You are a star. That's it! Do you know by any chance how I loop through the array to be displayed as a list?Son Link to comment Share on other sites More sharing options...
Lulzim Posted December 2, 2008 Share Posted December 2, 2008 something like this? $str = "asd, dssaa, dasfefe, dff"; $list = explode(",", $str); echo "<ul>"; foreach ($list as $item) { echo "<li>".$item."</li>"; } echo "</ul>"; Link to comment Share on other sites More sharing options...
son Posted December 2, 2008 Author Share Posted December 2, 2008 something like this? $str = "asd, dssaa, dasfefe, dff"; $list = explode(",", $str); echo "<ul>"; foreach ($list as $item) { echo "<li>".$item."</li>"; } echo "</ul>"; Thanks Lulzim,Great help;-)Son Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.