Hi All,
I have one value as:
$searchVal = "e:\\shared\\Alihaider-purani jeans.mp3||AliHaider - Purani Jeans@@e:\\shared\\KantaLaga.mp3||DJ Doll - Kanta Laga@@" ;
How can I create a table from this value in following way:
(Each table row data is separated by "@@" and the displayed TD data is the second token in every row value, separated by"||")
<TABLE>
<TR>
<TD vAlign=center align=left bgColor=#2e2e2e height=30>
<input type='hidden' name='row1' value='e:\\shared\\Alihaider-purani jeans.mp3||AliHaider - Purani Jeans'>
AliHaider - Purani Jeans
</TD>
</TR>
<TR>
<TD vAlign=center align=left bgColor=#2e2e2e height=30>
<input type='hidden' name='row1' value='e:\\shared\\KantaLaga.mp3||DJ Doll - Kanta Laga'>
DJ Doll - Kanta Laga
</TD>
</TR>
</TABLE>
Please help me. Its very urgent.
Thanks in advance.
How to create table rows data from a tokenized value
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
<table>
<?php
$searchvar = "e:\\shared\\Alihaider-purani jeans.mp3||AliHaider - Purani Jeans@@e:\\shared\\KantaLaga.mp3||DJ Doll - Kanta Laga@@";
$songs = explode("@@",$searchvar);
foreach($songs as $k => $song)
{
if(empty($song))
continue;
list($file,$name) = explode("||",$song);
echo<<<EOD
<tr>
<td vAlign=center align=left bgColor=#2e2e2e height=30><input type='hidden' name='row$k' value='$song'>$name</td>
</tr>
EOD;
}
?>
</table>
Last edited by feyd on Thu May 13, 2004 4:55 am, edited 1 time in total.