Jump to content

having issues with strpos


drumhrd
Go to solution Solved by drumhrd,

Recommended Posts

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 by drumhrd
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.