I have a piece of code that extracts delilminated text from a text file and puts it onto a HTML page.
The code is below and here is the page. I'm trying to get the str_replace function to get the " out of the text file but it doesn't seem to work and this is why my pictures are not showing. Instead of www.????/CITY_082408.jpg I get www.???/"CITY_476474.jpg as the URL. The code below extracts " out of the text file too as it is at the beginning of each line. I tried the below but it didn't work. Any ideas?
Thanks
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head><body bgcolor="#86B3C8" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<table width="100%" border="0" cellspacing="0" cellpadding="5" height="100%">
<tr align="center" valign="middle">
<td align="left">
<table width="300" border="1" cellspacing="0" cellpadding="3" bordercolor="#000000">
<tr>
<td><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="2">
<?php
$array = file("xfile.txt");foreach($array as $row) {
$line = explode('","', $row);
$search = array('"');
$replace = array('');
$array = str_replace($search, $replace, $array);
print "<b>Address:</b> $line[2] <br><b>Post Code:</b> $line[5] <br> <b>Price:</b> £$line[7] <br><b>Description:</b> $line[38]<br><img src=http://www.londonorient.com/$line[0]_$line[1].jpg><br><br><hr align='left' width='100%'><br>";
}
?>
</font> </td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>