|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-07-12 20:20 UTC] sterling at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Jun 14 22:00:01 2026 UTC |
array_walk() is limited in the way a) it cannot call methods in classes and b) it?s not possible to call functions which expect one parameter like htmlspecialchars(); the prior fixing of (a) would enable the user to write a wrapper functions in classes to be able to use single-parameter functions though Test script: <?php $obj=new RX_mail(1); class RX_mail { var $examples=array(1=>array('foo@foo.com','"foo"@subfoo.foo.com', '*@foo.com'), 2=>array('"foobiee" <foo@foo.com>','<subfoo@sub.foo.com>')); function RX_mail($type) { $this->array=$this->examples[$type]; // Before returning $this->examples[$type] I wanted to array_walk // all items to be able to display them // 1) does not work array_walk($this->array,'htmlspecialchars'); // 2 does not work, as said array_walk($this->array,'this->wrapper'); } function wrapper(&$param1,$param2='') { return htmlspecialchars($param1); }} ?>