Re: [PHP] Print a variable's name

2004-05-05 Thread Ahbaid Gaffoor
That's the way I ended up going pass the name and value along :) Not what I was hoping for, but it gets the job done, and it's only for debugging pruposes thanks Ahbaid. Michal Migurski wrote: but what I want is to be able to pass any variable to a procedure and have the variable name and

Re: [PHP] Print a variable's name

2004-05-05 Thread Michal Migurski
> but what I want is to be able to pass any variable to a procedure and > have the variable name and value printed by the procedure. Because PHP passes arguments by value, you will be out of luck in most cases -- by the time your debugging function sees the argument, it's no longer tied to the cal

Re: [PHP] Print a variable's name - FIXED

2004-05-05 Thread Ahbaid Gaffoor
ame."\n"; echo "Variable Value: ".$var."\n"; } showvar($test); This is the only thing that works for me.I know it is messy -Original Message- From: Michael Sims [mailto:[EMAIL PROTECTED] Sent: 05 May 2004 4:23 PM To: [EMAIL PROTE

RE: [PHP] Print a variable's name

2004-05-05 Thread Michael Sims
Dave Avent wrote: > function showvar($var) { > > foreach($GLOBALS as $key => $value) { > if($value == $var) { > $varname = $key; > } > } The problem with the above is that it assumes that th

RE: [PHP] Print a variable's name

2004-05-05 Thread Dave Avent
EMAIL PROTECTED] Sent: 05 May 2004 4:23 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Print a variable's name Ahbaid Gaffoor wrote: > Thanks Ryan, > > but what I want is to be able to pass any variable to a procedure and > have the variable name and value printed by the pro

RE: [PHP] Print a variable's name

2004-05-05 Thread Michael Sims
Ahbaid Gaffoor wrote: > Thanks Ryan, > > but what I want is to be able to pass any variable to a procedure and > have the variable name and value printed by the procedure. > > Can this be done? > > I'm trying to extend my library of debugging functions/procedures by > having a procedure which ca

Re: [PHP] Print a variable's name

2004-05-05 Thread Ahbaid Gaffoor
Thanks Ryan, but what I want is to be able to pass any variable to a procedure and have the variable name and value printed by the procedure. Can this be done? I'm trying to extend my library of debugging functions/procedures by having a procedure which can be used to "inspect" a variable whenev

Re: [PHP] Print a variable's name

2004-05-05 Thread Ryan A
Just escape it... eg: $ryan = "something"; echo "\$ryan =".$ryan; that would print: $ryan = something HTH. Cheers, -Ryan On 5/5/2004 5:02:25 PM, [EMAIL PROTECTED] wrote: > I'd like to print a variable's name in a procedure along with it's value > > Is there a way to do this? > > > fo

[PHP] Print a variable's name

2004-05-05 Thread Ahbaid Gaffoor
I'd like to print a variable's name in a procedure along with it's value Is there a way to do this? for example: --- function showvar($somevar) { echo "Now showing: ". <... code to show var name .> ."\n";