note 58667 added to function.arrayiterator-valid

From: Date: Fri, 11 Nov 2005 09:55:00 +0000
Subject: note 58667 added to function.arrayiterator-valid
Groups: php.notes 
Request: Send a blank email to php-notes+get-98420@lists.php.net to get a copy of this message
Sometimes you need to search through the array. Here is my object-orientated Version: class MyArrayIterator extends ArrayIterator { public function available($value) { if (in_array($value, (array)$this)) return true; else return false; } public function search($value) { foreach((array)$this as $Key => $values) { if ($values == $value) return $Key; } return false; } } ---- Manual Page -- http://www.php.net/manual/en/function.arrayiterator-valid.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+58667 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58667&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58667&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58667&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58667&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58667&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58667&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58667&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+58667&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#98420) next »