PHPBuilder - array_key()



RSS Twitter
Snippets Algorithms

array_key()

by: Christian Dechery
|
April 2, 2001

Version: 1.0

Type: Function

Category: Algorithms

License: GNU General Public License

Description: function that returns the numeric key of the array given the value, usefull when 'walking' thru arrays in multiple files...



function array_key($haystack,$needle)
{
	foreach($haystack as $key => $value)
	{
		if($haystack[$key] == $needle)
			return $key;
	}
	return false;
}

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Christian Dechery

Comment:



Comment:

(Maximum characters: 1200). You have characters left.