From: Anacreo <an...@gm...> - 2007-10-14 15:05:55
|
I believe the parser may be confusing your variables $to0 and $to... I try and avoid numbers in variable names because if you need to number your variables you should probably be using an array. Have you thought about using something like a sprintf print_r($to); // Debug me $to $string = sprintf('"%s" <%s>',$to[0], $to[1]); // Format my string echo $string . "\n"; // Debug my string Alec On 10/14/07, Ted Knudson <te...@aa...> wrote: > > Hello everybody, long time not problems > > I am creating a small PHP mailing program. > > 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); > 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 > $to="\"".$to0." <".$to1.">"."\""; //Only prints "$to0 > echo $to."<p>\n"; //Prints above > } > fclose($handle); > > > > Ted Knudson > www.aaWorldSales.com > 1-800-204-2422 > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > |