Feature request - simple function to get variable name as a string |
[eluser]adityamenon[/eluser]
Currently, I'm using a custom helper with this code. But, I think this a necessary function that codeigniter needs to have built in, and loaded automatically... submitted for the kind consideration of the admins for inclusion in the next iteration of CI.
[eluser]WanWizard[/eluser]
Can you give an example (in code) of where you would like to know the name of a variable, but you don't? I can't imagine needing a function like this...
[eluser]adityamenon[/eluser]
I regret posting this request now. Indeed, Wizard, you are right, there is no situation where this would be needed. I was going to use this for inserting TRUE/FALSE values into a database depending on whether or not a corresponding checkbox was ticked. I thought this would be necessary, but I could achieve the same with a simple foreach $key = $value construct. Sorry for wasting all of your time. Still though, the code I was about to use was: Code: <?php It's in the PHP manual.
[eluser]WanWizard[/eluser]
I saw the code, I just struggled to find a practical application, hence the question. |
Welcome Guest, Not a member yet? Register Sign In |