drumhrd Posted August 25, 2015 Share Posted August 25, 2015 (edited) I am having difficulty getting this to work. I am reading in files and converting them to array. Some array values for some reason have unknown characters, or are blank. I am attempting to exclude these by simply matching values with "DEI". But this is not working. Array ( [0] => �� [1] => PoolSata TSFDEI RAID-6(6+2) 63121.7 42218.5 20903.1 33 0 [2] => IBMi_EFD TEFDEI 2-Way Mir 733.7 78.8 654.9 89 0 [3] => IBMi_FC TFFDEI 2-Way Mir 5269.1 438.9 4830.2 91 0 [4] => PoolFC_300 TFFDEI 2-Way Mir 13754.6 10160.8 3593.7 26 0 [5] => PoolEFD TEFDEI RAID-5(3+1) 4402.4 648.8 3753.6 85 0 [6] => IBMi_Clone TFFDEI 2-Way Mir 4294.3 343.0 3951.3 92 0 [7] => [8] => [9] => ) <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title></title> </head> <? $file665 = file("/vmax-status/665status.txt"); $file570 = file("/vmax-status/570status.txt"); ?> <pre> <?print_r($file665); #print_r($file570); ?> </pre> <? $search = "DEI"; foreach ($file665 as $line) { if( strpos($line, $search) !== false){ echo $line; } else{ echo "?"; } } ?> </html> Edited August 25, 2015 by drumhrd Quote Link to comment Share on other sites More sharing options...
Solution drumhrd Posted August 25, 2015 Author Solution Share Posted August 25, 2015 I just fixed the file generation script to strip encoding and special characters. seems to work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.