On my website I need to store several urls on my database.
Rather than storing each of them in a different row I chose to put them all in a single row (since when I call them, I need them all anyways).
To do that I store the urls in a single string separated by
||
http://url1.com/dhsg.php||http://url2.com/jjipg.php||http://url3.com/dbhm.php||http://url4.com/dheresg.php||...
<span>http://url1.com/...</span>
<span>http://url2.com/...</span>
<span>http://url3.com/...</span>
<span>http://url4.com/...</span>
What you search is the function explode.
<?php
$yourString = 'http://url1.com/dhsg.php||http://url2.com/jjipg.php||http://url3.com/dbhm.php||http://url4.com/dheresg.php';
$arrayWithURLs = explode('||', $yourString);
echo '<pre>' . print_r($arrWithURLs, TRUE) . '</pre>';
?>
The last echo gives you the result in readable form.