$arr = file('myfile.txt');
$ips = array();
foreach($arr as $line){
list($ip, $host) = explode(',',$line);
$ips[$ip]=$host;
}
More Related Contents:
- The best way passing value from jQuery to PHP
- how to set progress bar in file uploading using jquery? [closed]
- Writing PHP functions that has many parameters/modifiers [closed]
- Auto responder mail reverts fill all fields when i have filled them
- Undefined index: image3
- Receive JSON POST with PHP
- How to get innerHTML of DOMNode?
- PHP display image BLOB from MySQL [duplicate]
- Merge two arrays as key value pairs in PHP
- How do the PHP equality (== double equals) and identity (=== triple equals) comparison operators differ?
- Show AJAX upload status on progress element
- PHP passing $_GET in the Linux command prompt
- Replace Mcrypt with OpenSSL
- When should I use Memcache instead of Memcached?
- How to install a specific version of package using Composer?
- php – How do I fix this illegal offset type error
- Convert jpg image to gif, png & bmp format using PHP
- PHP array_filter with arguments
- Unexpected bracket ‘[‘ – PHP [duplicate]
- Preg match text in php between html tags
- CodeIgniter default controller in a sub directory not working
- Alternative for mysql_num_rows using PDO
- Updating product stock programmatically in Woocommerce 3
- PHP: add seconds to a date
- PHP sending variables to file_get_contents()
- Upload doesn’t work right when the file is too big
- laravel 5.3 new Auth::routes()
- How to force page not to be cached in PHP?
- PHP Pass Data with Redirect
- Allowing users to Refresh browser without the “Confirm Form Resubmission” pop-up