You are here: Getting names of variables passed to functions... « All PHP « IT news, forums, messages
Getting names of variables passed to functions...

Posted by BoneIdol on 10/10/07 11:11

Anyway to do it? I know you can use a variable's contents as a
variable name with $$name, but I'd like to do it the other way around.

<?php
function foo($bar)
{
return $bar;
}

$name = foo($variable_name);
?>

I'd like the function foo to return a string of the variable name
passed to it, in this case 'variable_name'. A friend of mine who does C
++ programming says that pointers are the way to go here, but as far
as I know PHP doesn't support them.

 

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

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