Reply to Re: accessing function arguments

Your name:

Reply:


Posted by jerry gitomer on 05/23/05 16:43

micha wrote:
> micha <chotiwallah@web.de> wrote in
> news:Xns965B92A7087Fchotiwallah@204.153.244.170:
>
>
>>i have the following code:
>>
>>function some_function($argument)
>> {
>> validate_arg();
>> //more code
>> }
>>
>>function validate_arg()
>> {
>> //this function validates the argument of some_function()
>> }
>>
>>is it possible for validate_args() to automatically read the argument
>>of some_function() or do i have to note the argument in the brackets
>>in any case?
>>
>>thx, micha
>>
>
>
> debug_backtrace() is a very good way, because it supplies a lot of other
> information too to use in my validator.
>
> thx, micha
>
Micha,
You have to specify the argument in the brackets. (Well, I
suppose it might be possible to avoid doing so, but why go
looking for trouble?)

So, your code should look like:
function some_function($argument)
{
validate_arg($argument);
//more code
}

function validate_arg($argument)
{
//this function validates the argument of some_function()
}

HTH
Jerry

[Back to original 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

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