<?php
// This is a string that i collect from my mysql db..
$string = "Item1,value1|item2,value2|item3,value3|item4,value4";
i want to turn it in to an array.. But the problem is that i want to split the string with | and use , as a separeator for item and value
$foo = array('item1'=>'value1','item2'=>'value2','item3'=>'value3','item4'=>'value4');
// this is want my array to do after all this...
print 'Related articles:<br />";
foreach($foo as $item => $value) {
print '<a href="'.$value.'">'.$item.'</a><br />';
}
?>