From: Richard L. <ce...@l-...> - 2007-10-16 19:26:14
|
On Sun, October 14, 2007 12:02 am, Ted Knudson wrote: > I need the code produce this "Name Lastname <Nam...@gm...>" > Any ideas as to why this code will not work? > > Ted Knudson > South Bend, IN > > $handle=fopen("list.csv","r"); > flock($handle,1); Unless you are writing to the file, an flock is probably not needed... > while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { > $num = count($data); > echo "<p> $num fields in line $row: <br /></p>\n"; > $row++; > for ($c=0; $c < $num; $c++) { > > echo "c".$c." ".$data[$c] . "<br />\n"; > > $to0 = $data[0]; > $to1 = $data[1]; > } > Echo $to0."<br>\n"; //Works OK > Echo $to1."<br>\n"; //Works OK > $to="\"".$to0." <"; //.$to1.">"."\""; //Works to this point > $to="\"".$to0." <".$to1;//.">"."\""; //Only prints "$to0 http://php.net/htmlentities The "<" symbol is not only "special" in an email address, it's also "special" in HTML. Any data you splat to the browser should have htmlentities() wrapped around it to escape any HTML special characters. You get away with not using htmlentities 99% of the time, but then you get burned later... -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? |