Skip to content

Instantly share code, notes, and snippets.

@mebcomputers
Created April 29, 2012 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mebcomputers/2551712 to your computer and use it in GitHub Desktop.
Save mebcomputers/2551712 to your computer and use it in GitHub Desktop.
php: explode to array from file
<?php
$filename = "file.txt";
$handle = fopen($filename, "r");
$data = fread($handle, filesize($filename));
$data_array = explode(",", $data);
foreach ($data_array as $value) {
echo $value.'<br>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment