php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #19920 Not a bug, but an add-on...
Submitted: 2002-10-15 12:25 UTC Modified: 2002-10-15 22:39 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: meggleston at matrixreg dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.2.0 OS: RedHat Linux 7.2
Private report: No CVE-ID: None
 [2002-10-15 12:25 UTC] meggleston at matrixreg dot com
I have a small snippit of code that I believe people would find very useful, however I was unsure as to where to stick it.

function array_multisearch($needle, $haystack, $strict = FALSE) {
	for ($x = 0; $x < count($haystack); $x++) {
		if (array_search($needle, $haystack[$x], $strict)) {return $x;}
	}
}

This function allows for arrays of hash-arrays kind of searching...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-15 14:15 UTC] webmaster at tsn dot dk
Maybe you should add it as a comment to array_search in the manual?
 [2002-10-15 22:39 UTC] sniper@php.net
Add this kind of comments to the manual.

 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Jan 01 07:00:01 2026 UTC