How to separate database entries and display them as individual records using PHP?

Posted by Clark on Stack Overflow See other posts from Stack Overflow or by Clark
Published on 2010-03-24T21:36:05Z Indexed on 2010/03/24 22:23 UTC
Read the original article Hit count: 204

Filed under:
|

I used to have database entries separated by ampersands (&), but this was causing certain search issues so I decided to encapsulate my entries on both sides by $ and & symbols like:

$this&

But I am having trouble displaying all the entries of a cell as individual records. Before I used:

$unsplitItems = $row['files'];

$files = explode("@", $unsplitItems);

foreach ($files as $file) {

   if(strlen($file)) {

      echo "<li>$file</li>";

   }

}

Any idea how I can split my records and display all the items in the array as individual entries?

© Stack Overflow or respective owner

Related posts about php

Related posts about database