note 30400 added to function.reset
| From: | gearond at cvc dot net | Date: | Mon, 17 Mar 2003 07:13:02 +0000 |
| Subject: | note 30400 added to function.reset | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45405@lists.php.net to get a copy of this message | ||
reset does not seem to work inside of a function. The interpreter doesn't seem to want to wait
until the second pass to do an error message, it chokes on the function definition, AFAICT.
.
Example, to clear a form made from a Smarty template where each form element has
value="{$element_name}" in it, and you have all the element names in an array, do this:
.
function clr_tpl_vals( &$smarty_object, &$arr_var_names ){
....reset $arr_var_names;
....foreach( $arr_var_names as $name ) {
........$smarty_object->assign( $name, '');
....}
}
.
unfortunately, the interpreter chokes on the reset line.
--
http://www.php.net/manual/en/function.reset.php
http://master.php.net/manage/user-notes.php?action=edit+30400
http://master.php.net/manage/user-notes.php?action=delete+30400
http://master.php.net/manage/user-notes.php?action=reject+30400