Hello Cristiano,

  First, I'd like to say that a function of this type sounds useful.
  It's one that I've wanted for some time, particularly for verifying
  that an array has the correct keys when it is passed as a function
  parameter.
  
  If I understand what you are doing correctly, the same thing can be
  accomplished by:

     array_intersect(array_keys($records), array(234, 567, 890, 123))

  However, I agree that array_diff_key() and array_intersect_key()
  would be significantly useful functions to add to the core.

-- 
Best regards,
 Jason                            mailto:[EMAIL PROTECTED]

Tuesday, July 20, 2004, 3:16:20 PM, you wrote:

CD> Hi all,

CD> I needed to intersect an array with database records indexed by the primary
CD> key, with an array with keys and there is no php function that will do it
CD> internally. 
CD> The database array looks like:
CD> $records = array ( 2587 => array('Name', 'Address', 'zip'), ...);

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to