Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2001072

RE: [PHP] removing lines from array From: Adrian Ciutureanu (adrian.ciutureanu <email protected>)
Date: 07/23/01

<?
        $recordsarray = file ("../auto/records");
        $remove = "schopf.net ";
        while(list($i, $line) = each($recordsarray)) {
                if(ereg($remove, $line)) {
                        unset($recordsarray[$i]);
                }
        }
        $newFileContent = implode('', $recordsarray);
?>

> -----Original Message-----
> From: Richard Kurth [mailto:rkurth <email protected>]
> Sent: 23 iulie 2001 02:36
> To: php
> Subject: [PHP] removing lines from array
>
>
>
> I an trying to figure out how to remove lines from a text file from
> within an array.
>
> I fill the array with this
>
>
> The lines I what to remove have this in them
>
>
> What I need is how to loop through this array and pull out
> the lines
> that have what is in the $remove variable.
>
> Then I will write the array to a temp file and thin copy it back to
> the records file
>
>
> This is a small sample of the file I what two remove lines from
> mx - schopf.net High www.schopf.net
> ptr - readinggenius.tv 207.200.75.55 24
> a - time-management-by-higher-productivity.com 207.252.75.55 24
> ptr www speedreading123.com 207.200.75.55 24
> ptr - mindbodyspirit123.com 207.200.75.247 24
> a www schopf.net 207.252.75.242 24
> soa - schopf.net
> dns1.northwesthost.com:dns2.northwesthost.com:rkurth <email protected>
> westhost.com:10800:3600:604800:86400 -
>
>
>
>
>
>
>
>
>
>
>
> Best regards,
> Richard
> mailto:rkurth <email protected>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe <email protected>
> For additional commands, e-mail: php-general-help <email protected>
> To contact the list administrators, e-mail:
> php-list-admin <email protected>
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>