You are here: Re: [PHP] Retrieving variable name? « PHP « IT news, forums, messages
Re: [PHP] Retrieving variable name?

Posted by Scott Noyes on 09/22/05 01:00

> is it possible to retrieve the name of a variable passed into a
> function from within the function?

Sure. Use debug_backtrace to figure out what line and what file the
caller is in, then read that file, find that line, find the function
call within that line, and read what ever is between the parentheses.

Can't think of why you'd want to do this, though...

 

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

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