You are here: Getting 'by reference' error using array_walk. How do I use it then? « PHP Programming Language « IT news, forums, messages
Getting 'by reference' error using array_walk. How do I use it then?

Posted by lwoods on 11/18/05 20:26

I have the following function:

function clean_form( &$from_check ) {
if(is_array($from_check)){
array_walk(&$from_check,'clean_form');
return;
} else {
$value = str_replace(array("\r","\n","Content-Type:"),"",$from_check);
}

When I call this function I get the following warning:

Warning: Call-time pass-by-reference has been deprecated - argument passed
by value; If you would like to pass it by reference, modify the declaration
of array_walk(). If you would like to enable call-time pass-by-reference,
you can set allow_call_time_pass_reference to true in your INI file.
However, future versions may not support this any longer.

In the PHP doc it shows referencing the array argument "by reference"; i.e.
'&' , but the runtime says this is a "no go". Then how am I supposed to use
array_walk?

TIA,

Larry Woods

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация