Welcome Guest, Not a member yet? Register   Sign In
Format into array format. Please help!
#8

[eluser]murphy2006[/eluser]
Thank you MadZad!

This is how I made it:

Code:
<?php

$my_file = fopen("D:/internet/server/wamp/www/stader.txt", "r");
if (!$my_file) {
  echo "ah, bugger";
  exit();
}
$town_arr = array();
while ($my_line = fgets($my_file)) {
  $town = trim($my_line);
  if (empty($town)) continue;
  // $town should contain just the town name, with internal whitespace intact
  $town_arr[] = $town;

echo '"'.$town.'",';
}
fclose($my_file);
// Do your processing on $town_arr here

?>

Have a fantastic weekend!

Kind Regards,
Daniel


Messages In This Thread
Format into array format. Please help! - by El Forum - 03-06-2008, 06:22 AM
Format into array format. Please help! - by El Forum - 03-06-2008, 07:25 AM
Format into array format. Please help! - by El Forum - 03-06-2008, 09:04 AM
Format into array format. Please help! - by El Forum - 03-06-2008, 09:19 AM
Format into array format. Please help! - by El Forum - 03-06-2008, 09:50 AM
Format into array format. Please help! - by El Forum - 03-06-2008, 11:06 AM
Format into array format. Please help! - by El Forum - 03-06-2008, 11:12 AM
Format into array format. Please help! - by El Forum - 03-06-2008, 12:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB