[PHP] Re: deleting array elements

2004-03-09 Thread Sven
Benjamin Jeeves schrieb:

Hi All 

I have two array one with a list of items in it. Then a second array with a list of items in it what I want to be able to do is compare array1 to array2 and if a match is found in both arrays delete that match from array1 and then so now? Any help would be good.

so array1 = (1,2,3,4,5)
array2 = (1,3,5)
then print array1 and the output be 2,4

Thank you

hi,
try array_diff() or array_intersect() or any other corresponding function.
hth sven
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Deleting Array elements

2001-11-02 Thread Liz Fulghum

One idea is to read the file into an array, use substr to match the
existance of the user to be deleted, and if the user isn't to be deleted,
read the line into a new array, then write the new file to the array.

Hew Staff [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm looking for some code that will enable me to remove a line from a
file.

 I have .htaccess which is being filled by a subscription processor, I need
 to know how to remove a user from this file once the subscription has
either
 been cancelled or subscription term complete.

 Any help appreciated.
 Thanks
 Jonno





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]