You are here: Re: can one get the name of parameters passed to a function? « PHP Programming Language « IT news, forums, messages
Re: can one get the name of parameters passed to a function?

Posted by Andy Hassall on 04/16/07 19:51

On 15 Apr 2007 22:19:57 -0700, "lawrence k" <lkrubner@geocities.com> wrote:

>One thing I like about Ruby is the use of symbols when passing
>function parameters to a function. One thing I dislike about PHP is
>that if a function has 4 optional parameters but you want to do
>something with the 4th one, you need to put in something, perhaps
>empty strings, for the first 3 parameters, even though you've no
>interest in using them.
>
>I'm wondering if there is anyway to emulate the Ruby style with
>something like this:
>
>http://us2.php.net/manual/en/function.func-get-args.php
>
>Is there a way to get the parameters as an associative array? A
>numerically indexed array is just as useless as the normal style of
>passing arguments.

For an insane solution, search Google Groups for "This calls for the power of
Bobo the Clown" (seriously).

Otherwise, pass an associative array.
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

 

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

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