note 81624 added to function.array-walk
| From: | mikemikeATdebitage dot com at osu1 dot php dot net | Date: | Thu, 06 Mar 2008 20:01:55 +0000 |
| Subject: | note 81624 added to function.array-walk | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136802@lists.php.net to get a copy of this message | ||
<?php
/**
* class.ArrayTool.php lets you search an array based on key => value pairs
*
* @version 1.0
* @ 1-11-2008
* @author Mike Volmar
*
* Object for converting between array key and value
*
*/
class ArrayTool {
var $mydata = array();
var $flag = 0;
var $results;
function ArrayTool(){
}
function tellAll(){
print_r($this->mydata);
}
function setArray($data){
$this->mydata = $data;
}
function getKey($input){
foreach($this->mydata as $key => $value){
if(($this->flag == 0)&&($input == $value)){
$this->results = $key;
$this->flag = 1;
}
}
$this->flag = 0;
return $this->results;
}
function getValue($input){
foreach($this->mydata as $key => $value){
if(($this->flag == 0)&&($input == $key)){
$this->results = $value;
$this->flag = 1;
}
}
$this->flag = 0;
return $this->results;
}
}
?>
----
Server IP: 208.69.120.35
Probable Submitter: 65.220.90.98
----
Manual Page -- http://www.php.net/manual/en/function.array-walk.php
Edit -- https://master.php.net/note/edit/81624
Del: integrated -- https://master.php.net/note/delete/81624/integrated
Del: useless -- https://master.php.net/note/delete/81624/useless
Del: bad code -- https://master.php.net/note/delete/81624/bad+code
Del: spam -- https://master.php.net/note/delete/81624/spam
Del: non-english -- https://master.php.net/note/delete/81624/non-english
Del: in docs -- https://master.php.net/note/delete/81624/in+docs
Del: other reasons-- https://master.php.net/note/delete/81624
Reject -- https://master.php.net/note/reject/81624
Search -- https://master.php.net/manage/user-notes.php