If I have a variable, how do I extract the name of the variable.
In principle:
$varname=somefunction($myvar);
The value of $varname is then "myvar"
How do I do it?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
:48 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Variable Appended To The End of a URL Is Not Working
in SQL Query
Hmm, run it manually? I'm a newbie, so, could you explain how I'd do that?
=)
"Jason Murray" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">
ongren
Captain Jack Communications
[EMAIL PROTECTED]
www.captainjack.com
- Original Message -
From: "Dr. Shim" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 01, 2002 10:41 PM
Subject: [PHP] Variable Appended To The End of a URL Is Not Wo
On Mon, 1 Apr 2002, Dr. Shim wrote:
> I have a variable which is appeneded to the end of a URL, like
>
> http://www.your_web_site.com/your_page/?your_variable=your_value
>
> This would return "your_value";
>
> echo $your_variable;
>
> But this wouldn't work, and returns an error
>
> $sql = "S
odbc_close($db);
?>
Tyler Longren
Captain Jack Communications
[EMAIL PROTECTED]
www.captainjack.com
- Original Message -
From: "Dr. Shim" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 01, 2002 10:41 PM
Subject: [PHP] Variable Appended To The End of a
Maybe you should echo out your SQL and run it manually to see
what's going on.
J
--
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
"Work now, freak later!"
> -Original Message-
> From: Dr. Shim [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 02,
Message-
> From: Dr. Shim [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 02, 2002 2:41 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Variable Appended To The End of a URL Is Not Working in
> SQL Query
>
>
> I have a variable which is appeneded to the end of a URL, l
I have a variable which is appeneded to the end of a URL, like
http://www.your_web_site.com/your_page/?your_variable=your_value
This would return "your_value";
echo $your_variable;
But this wouldn't work, and returns an error
$sql = "SELECT * FROM fldField WHERE IDField = " . $id;
What coul
On 22 Mar 2002 at 17:27, Rick Emery wrote:
> ${varable}ABC
in quotes you can help php with
{$(varabl)}ABC
>
>
> -Original Message-
> From: Leif K-Brooks [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 22, 2002 5:21 PM
> To: Rick Emery
> Subject: Re
${varable}ABC
-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 5:21 PM
To: Rick Emery
Subject: Re: [PHP] Variable problem
on 3/22/02 6:18 PM, Rick Emery at [EMAIL PROTECTED] wrote:
show your code
-Original Message-
From
show your code
-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 5:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Variable problem
I have a variable name in a print <<< END and then some text after it. The
thing is, php thinks that th
I have a variable name in a print <<< END and then some text after it. The
thing is, php thinks that the text is part of the variable name, which makes
the variable, and the text after it, not show up. But, if I put a space, it
makes my html not work right. Any ideas?
--
PHP General Mailing
>
> if($x)
>echo $x;
if $x is not defined you will get a warning but that depends on error settings in
php.ini.
This construction checks whether $x is defined or $x is true.
>
> if(!empty($x))
>echo $x;
$x must be defined.
>
> --
> PHP General Mailing List (http://www.php.net/)
> T
Hi,
I'm asking me, what is the difference of the two "ifs".
if($x)
echo $x;
if(!empty($x))
echo $x;
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi. I want to be able to access a key in a multidimensional array at some
depth "n" without knowing before runtime what the keys are.
I thought this might be possible using variable variables. Here's some
sample code using variable variables and multidimensional arrays:
$y = 'a';
$z = 'b';
$t = '
Something most have just been wigging out or something because I can't get
it to do it again. Maybe I just did something wrong, but it seems to be
working now. Thanks for the help though,
Dave
"Lars Torben Wilson" <[EMAIL PROTECTED]> wrote in message
1015973063.2146.82.camel@ali">news:1015973063.
On Tue, 2002-03-12 at 14:38, David Johansen wrote:
> I have a little chunk of code that checks to see if a variable exists and if
> not then it sets it. It goes like this:
>
> if (empty($page))
> {
>$page = "login";
> }
>
> I then end that part of the php script after doing what I need to. T
I have a little chunk of code that checks to see if a variable exists and if
not then it sets it. It goes like this:
if (empty($page))
{
$page = "login";
}
I then end that part of the php script after doing what I need to. Then I
start up again on the same html page and I assumed that $page h
Hello,
I created a librairy with configuration setting: background color, font size,
customer's name, etc. Like this:
(lib_config.inc)
$bgcolor = "#ff";
$co = "ABC enterprise";
A second file is building html page headders:
(lib_intra.inc)
function title($name_section,$name_page){
print "\
You can add hidden field in form and before posting set it value to js
variable value that can be easily used by PHP script
Valentin Petruchek (aki Zliy Pes)
*** Cut the beginning ***
http://zliypes.com.ua
mailto:[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscr
Hi,
does anyone has an idea and example how to get the value of a js variable
into a
PHP variable, preferably working with sessionvariables or a hiddenform?
thank you!
Simon
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
nt: Friday, January 18, 2002 2:26 PM
Subject: RE: [PHP] Variable problem
> Use an array !?, I mean :
>
> $result[$i] = "test";
>
> > How do I combine the following so it is treated as one variable
> >
> > $i=10
> >
> > $result$i="tes
Hello,
> $func = "make_" . $wat;
> $temp = $$func($this);
I think one $.
$func = "make_" . $wat;
$temp = $func($this);
will work
Bas
Op donderdag 31 januari 2002 12:17, schreef u:
> Hoi Bas,
>
> $func = "make_" . $wat;
>
> $temp = $$func($this);
>
> bvr.
>
> On Thu, 31 Jan 2002 11:55:12 +0100
On Thu, 2002-01-31 at 02:55, Bas Jobsen wrote:
> Hello,
>
> > Thanks all. I will rename the second function.
>
> Now if have:
>
> if($wat=="naam")$temp=make_naam($this);
> else if($wat=="anderenaam")$temp=make_anderenaam($this);
> //etc..
>
> But i would prefer something like
> $temp=make_$wat
Hoi Bas,
$func = "make_" . $wat;
$temp = $$func($this);
bvr.
On Thu, 31 Jan 2002 11:55:12 +0100, Bas Jobsen wrote:
>Hello,
>
>> Thanks all. I will rename the second function.
>
>Now if have:
>
>if($wat=="naam")$temp=make_naam($this);
>else if($wat=="anderenaam")$temp=make_anderenaam($this);
Hey Bas,
BV>But i would prefer something like
BV>$temp=make_$wat($this);
I think you might want something along these lines:
eval("make_$wat($this);");
HTH
-jeff
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAI
Hello,
> Thanks all. I will rename the second function.
Now if have:
if($wat=="naam")$temp=make_naam($this);
else if($wat=="anderenaam")$temp=make_anderenaam($this);
//etc..
But i would prefer something like
$temp=make_$wat($this);
How can i do this?
Tnx,
Bas
--
PHP General Mailing List (
${$vNames[1]} = "new value"; // look at variable-variables in the manual
for more info
-Original Message-
From: Gaylen Fraley [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 20, 2002 3:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Variable referencing/substitution
How can th
How can this be done?
If I have the name of a variable that is stored in an array, how do I use
the stored value to represent the actual variable?
Example:
$variable = "old value";
$vNames[1] = '$variable'; //literal $variable
I want to say $vNames[1] = "new value"; /and have $variable actua
> > Well, I'll try the technique you mentioned.
> > Your offering is very appreciated.
> > Thank you!
> > :-]
> >
> > ps.
> > execute me for my english...
> >
> > ---
> > K.Tomono
> >
> >
>
ecute me for my english...
>
> ---
> K.Tomono
>
>
> > -Original Message-
> > From: Philip Olson [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, January 19, 2002 2:30 PM
> > To: Fì¤á
> > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED
On Saturday 19 January 2002 14:45, K.Tomono wrote:
> Yes, I think too, it's better way to use an array rather than a dynamic
> name of the variable.
>
> I thought that the first question means how to use a dynamic variable.
>
> By the way,
>
> > little array propaganda, jic :) Arrays work great
¤á
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] Variable Problem
>
>
>
> > How do I combine the following so it is treated as one variable.
>
> It's a good question, but why? Most likely an array will
> work best for
> this job, arrays are go
> How do I combine the following so it is treated as one variable.
It's a good question, but why? Most likely an array will work best for
this job, arrays are good:
http://www.php.net/manual/en/language.types.array.php
The man page on foreach is nice too, and has many examples which include
Hello.
>How do I combine the following so it is treated as one variable
>
>$i=10
>$result$i="test";
>
>I want this to be:
>
>$result10="test";
>
>$i changes so I cannot just put in 10 instead of I.
>anybody know how i can do that?
>
>TIA
>Randy
How about the below.
or
Cheers :-)
---
Use an array !?, I mean :
$result[$i] = "test";
> How do I combine the following so it is treated as one variable
>
> $i=10
>
> $result$i="test";
>
>
> I want this to be:
>
>
> $result10="test";
>
>
> $i changes so I cannot just put in 10 instead of I.
>
>
> anybody know how i can do that?
-
Valentin Petruchek (aki Zliy Pes)
http://zliypes.com.ua
mailto:[EMAIL PROTECTED]
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 19, 2002 2:47 AM
Subject: [PHP] Variable Problem
>
>
> How do I combine the followin
How do I combine the following so it is treated as one variable
$i=10
$result$i="test";
I want this to be:
$result10="test";
$i changes so I cannot just put in 10 instead of I.
anybody know how i can do that?
TIA
Randy
--
PHP General Mailing List (http://www.php.net/)
To unsubscrib
On Thu, 17 Jan 2002 11:11:43 -0500, you wrote:
>I can not wrap my head around variable variables today, not awake yet or
>something.
>
>For instance I trying something like this:
>
>while ($i<$loopcounter) {
> $temp = "size";
> $valueofsize = $$temp$i;
> $i++;
>}
What about
$i
$valueofsize = ${"size" . $i};
or
$var = "size" . $i;
$valueofsize = $$var;
bvr.
On Thu, 17 Jan 2002 11:11:43 -0500, Mike Krisher wrote:
>I can not wrap my head around variable variables today, not awake yet or
>something.
>
>For instance I trying something like this:
>
>while ($i<$loopcount
On Thursday, January 17, 2002, at 10:11 AM, Mike Krisher wrote:
> I can not wrap my head around variable variables today, not awake yet or
> something.
>
> For instance I trying something like this:
>
> while ($i<$loopcounter) {
> $temp = "size";
> $valueofsize = $$temp$i;
>
try $va
p: http://graphictype.com/scott/pgp.txt
> -Original Message-
> From: Mike Krisher [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 17, 2002 11:12 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] variable variables
>
>
> I can not wrap my head around
I can not wrap my head around variable variables today, not awake yet or
something.
For instance I trying something like this:
while ($i<$loopcounter) {
$temp = "size";
$valueofsize = $$temp$i;
$i++;
}
this doesn't work obviously, $valueofsize ends up with a literal valu
$row[coloumname_${v$ariable}]
-Original Message-
From: Dani [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 16, 2002 8:36 AM
To: [EMAIL PROTECTED]
Subject: [PHP] variable problem - help!
Importance: High
Hi!
I 'm trying not to hard code my php coding and I'm trying
Thanks for the reply!
I really appriciate it!
I'll try it first!
regards,
Dani
Stefan Rusterholz wrote:
> > Hi!
> >
> > I 'm trying not to hard code my php coding and I'm trying to pass a
> > variable name into the $row[coloumname_$variable];
> $row["columname_$variable"] should do it.
> $row
> Hi!
>
> I 'm trying not to hard code my php coding and I'm trying to pass a
> variable name into the $row[coloumname_$variable];
$row["columname_$variable"] should do it.
$row[constant] is threaten as constant which is normally not the programmers
intention (set_error_reporting(0) and you'll see
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
* On 16-01-02 at 12:45
* Dani said
> Hi!
>
> I 'm trying not to hard code my php coding and I'm trying to pass a
> variable name into the $row[coloumname_$variable];
>
> I get an error message for this code.
>
> I'm just wondering if I could
Hi!
I 'm trying not to hard code my php coding and I'm trying to pass a
variable name into the $row[coloumname_$variable];
I get an error message for this code.
I'm just wondering if I could do this trick using other ways of writing
it.
Thanks for reviewing!
regards,
Dani
--
PHP General Ma
A quick rewrite of your code:
";
}
?>
Your question was how to print the query, in this case you'd just print
$sql. That was the point of the above but I got a bit carried away :) Oh,
mysql_error() can be very useful for debugging. Regarding the type
resource, have a look here:
http://ww
something like
someColumnInTable;
echo $row->someOtherColumnInTable;
}
?>
-- Original Message --
From: "louie miranda" <[EMAIL PROTECTED]>
Date: Fri, 4 Jan 2002 04:45:57 +0800
Hi, is it possible to print the sql query? i mean
i want to print the output
use
$sql = "select .. ";
$result = mysql_query($sql);
echo $sql;
--- louie miranda <[EMAIL PROTECTED]> wrote:
> Hi, is it possible to print the sql query? i mean
> i want to print the output of the command "SELECT * FROM
> members;"
> and output it into html, i tried
>
> print $result; -- i
Hi, is it possible to print the sql query? i mean
i want to print the output of the command "SELECT * FROM members;"
and output it into html, i tried
print $result; -- it gives me different output..
> Resource id #2
ty,
louie...
# PHP SCRIPT ###
--
T. +41 1 253 19 55
F. +41 1 253 19 56
W3 www.interaktion.ch
--
- Original Message -
From: "Bharath Bhushan Lohray" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, December 09, 2001 1:2
Is there a way of swapping the values of two variables without involving a
third variable.
something similar to the SWAP(A$,B$) of BASIC
I have a big variable(array) and I want to keep my script's memory
requirements as low as possible.
-Bharath Bhushan Lohray
--
PHP General Mailing List (h
function _compile_lang($key){
global $_lang;
return $_lang[$key[1]];
} // End _compile_lang
HTH
Regards,
Andrey Hristov
- Original Message -
From: "Peter Bowyer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 03, 2001 3:45 PM
Subject
Hi,
Does anyone know of a way of passing other variables to the function being called by
preg_replace_callback? For instance, I have the following code:
function smarty_compile_lang($tpl_source) {
// en.php contains a very large array, $_lang
include_once '/home/test/en.php';
g
22@alfa">news:1104_1006021222@alfa...
> This is perhaps elementary, but I cannot find solution in the
documentation
>
> I want to transfer to a php variable wheter I find a matching firstname in
a group from mysql db
>
> function lookupFirstname ($fname, $gr, $conection)
>
This is perhaps elementary, but I cannot find solution in the documentation
I want to transfer to a php variable wheter I find a matching firstname in a group
from mysql db
function lookupFirstname ($fname, $gr, $conection)
{ $sql = "SELECT firstname AS matches ";
$sql .= &qu
e (and its original value)
are still accessible.
> -Original Message-
> From: Chris Hobbs [mailto:[EMAIL PROTECTED]]
> Sent: 13 November 2001 17:09
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] Variable definitions...
>
>
> Hi Stephan,
>
> IMHO,
Hi Stephan,
IMHO, I think the answer requested is the only one that really makes
sense - as soon as I read it, _my_ first thought went to scope.
If a variable changes values, the other value is no longer usable, and
thus there aren't really two variables with the same name in that case.
When
Hello,
first of all I didn't exactely know where the right place is to ask this
question.
Well, my problem is that I just had some exams and am very unhappy on
how certain things were rated.
There's especially one question and I try to translate it as exact as
possible:
When is it possible tha
Friday, November 09, 2001 2:37 PM
To: PHP General
Subject: [PHP] variable issue
Hey everyone, I need some help with a variable issue. How can I delcare
a variable and then if a url variable of the same name is present use
that value instead?
this is what I have:
if(!$dte)
{
$dte=date("j&
2001 2:37 PM
To: PHP General
Subject: [PHP] variable issue
Hey everyone, I need some help with a variable issue. How can I delcare
a variable and then if a url variable of the same name is present use
that value instead?
this is what I have:
if(!$dte)
{
$dte=date("j", time()+$ctime);
}
els
replace the if statement if(!$dte)
with
if (!isset($dte))
- Original Message -
From: "Johnson, Kirk" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Friday, November 09, 2001 2:35 PM
Subject: RE: [PHP] variable issue
> The else cla
The else clause can be removed, since it is not doing anything. What is the
error message?
Kirk
> Hey everyone, I need some help with a variable issue. How can
> I delcare a variable and then if a url variable of the same
> name is present use that value instead?
>
> this is what I have:
> if
Hey everyone, I need some help with a variable issue. How can I delcare a variable and
then if a url variable of the same name is present use that value instead?
this is what I have:
if(!$dte)
{
$dte=date("j", time()+$ctime);
}
else
{
$dte=$dte;
}
and this causing an error in the 'if' expression
> I have an two dimensional array that is returned from code from an included
> file. I'm assigning parts of the array to variables ( $variable =
> $array["key"]["value"]; ). This works fine and can be printed until I send
> it through a function eg. ( ereg_replace(" ", "_", "$variable"); ). After
Sorry all but I really need to figure this out. Here's a recap of my
problem:
I have an two dimensional array that is returned from code from an included
file. I'm assigning parts of the array to variables ( $variable =
$array["key"]["value"]; ). This works fine and can be printed until I send
it
Hello,
Is it possible to put variable operators in queries?
I tried this (the real variable comes from a form)
$Date_Operator =(">=");
sql="SELECT * FROM poeple WHERE age $Date_operator 20";
$result_id = mysql_query($sql);
It doesn't work like this. I also tried:
sql="SELECT * FROM poeple WHE
Hello all!
I installed PHP 4.0.6 om my server (Winnt server, Apache), and I started testing with
it.
The problem I have now is this:
I want to read the data passed from a form trough a variable.
Let's say the form field is called Test. I want to use $Test in my PHP script to read
that variable.
> > its really a big headache with compilers like c bugging all the way just for
>declarations.
One remark, btw. Using explicit declarations isn't really more of a
headache then _not_ using expl.decl. When you don't
use explicit declarations, you'll need to check wether or not a
variable is defi
From: sagar N Chand <[EMAIL PROTECTED]>
Date: Thu, Sep 27, 2001 at 06:01:26PM +0530
Message-ID: <005101c14750$c3189b10$0101a8c0@inferno>
Subject: Re: [PHP] Variable declaration
> its really a big headache with compilers like c bugging all the way just for
>declarations.
&g
Cc: [EMAIL PROTECTED]
Sent: Thursday, September 27, 2001 2:02 PM
Subject: Re: [PHP] Variable declaration
> That is the nature of a loosely typed scripting language.
I know.
> If you prefer a strongly typed compiled language, there are plenty
> of those available.
I
> That is the nature of a loosely typed scripting language.
I know.
> If you prefer a strongly typed compiled language, there are plenty
> of those available.
I know to. But those are not as powerful for building websites as
PHP. I mean... don't get me wrong here, I think PHP is great (or
even
That is the nature of a loosely typed scripting language. If you prefer a
strongly typed compiled language, there are plenty of those available.
-Rasmus
On Thu, 27 Sep 2001, * R&zE: wrote:
> > Like I said, that line does both. It sets the type internally to an
> > integer and assigns the valu
> Like I said, that line does both. It sets the type internally to an
> integer and assigns the value.
>
> -Rasmus
What he (Alberto) is looking for, and what I would prefer to, is to
really explicitly declare a variable. There's a difference between a
compiler that requires you to declare (inte
> > What do you mean force declaration? That's what you are doing with this
> > line:
> >
> > $Test = 3;
>
> Nop! This is just starting to use a variable. Something like:
>
>integer $Test;
>
> is declaring a variable. But FAFAIK it's not possible in PHP :(
Like I said, that line does both.
> What do you mean force declaration? That's what you are doing with this
> line:
>
> $Test = 3;
Nop! This is just starting to use a variable. Something like:
integer $Test;
is declaring a variable. But FAFAIK it's not possible in PHP :(
--
* R&zE:
--
-- Ren
On Thu, 27 Sep 2001, it was written:
> $Test=3;
> echo $Test;
> ?>
>
> And I get no warning about $Test not being declared before (like C
> declaration).
>
> Any1 has an example about forcing variable declaration?
What do you mean force declaration? That's what you are doing with this
line:
And I get no warning about $Test not being declared before (like C
declaration).
Any1 has an example about forcing variable declaration?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact
If I'm reading your snippet correctly, then :
$foo = 'bar';
$bar = array('apple','banana');
print ${$foo}[0]; // apple
Note the use of {braces}. The last paragraph in the manual describes this
a bit :
http://www.php.net/manual/en/language.variables.variable.php
Although I don't see
I can not figure out why this is not working!
for ($j=0; $j<$resultNum; $j++) {
$newvar = "finalresult".$a;
$$newvar[$a][name] = $resultRow[name];
$$newvar[$a][title]= $resultRow[title];
$$newvar[$a][descript] = $resultRow[descript];
$$newvar[$a][countkey] = substr_count("$resul
> I want PHP parser to warn/fail when I try to use a variable
> not declared before. Like "Option Explicit" on ASP/VBA.
Look here:
http://www.php.net/manual/en/function.error-reporting.php
Chris
I want PHP parser to warn/fail when I try to use a variable not declared
before. Like "Option Explicit" on ASP/VBA.
Thnx in advance :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the
That was the ticket. Thanks a lot for your help
Adam Plocher wrote:
> $id = 1;
> ${"sql_" . $id} = "hey";
> print $sql_1;
--
Kyle Moore
UNIX Systems Administrator
Trust Company of America
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additio
Read this
http://www.php.net/manual/en/language.variables.variable.php
Johan
www.pongworld.com
php tt
-Original Message-
From: Fábio Migliorini [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 25, 2001 12:28 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Variable naming
$id = 1
uesday, September 25, 2001 1:15 PM
Subject: [PHP] Variable naming
> I want to use the value of a variable in a variable name. For instance:
>
> $id = 1;
> $sql_$id = "hey"; //set variable $sql_1 to hey
> print $sql_1; //should print hey
>
> I have looked high and low
$id = 1;
${"sql_" . $id} = "hey";
print $sql_1;
Try that
-Original Message-
From: Kyle Moore [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 25, 2001 9:15 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Variable naming
I want to use the value of a variable in
> I want to use the value of a variable in a variable name. For
> instance:
>
> $id = 1;
> $sql_$id = "hey"; //set variable $sql_1 to hey
> print $sql_1; //should print hey
I *believe* (could be wrong) what you want is this:
print ${$sql_1};
Check out variable variables in the dox.
Chris
I want to use the value of a variable in a variable name. For instance:
$id = 1;
$sql_$id = "hey"; //set variable $sql_1 to hey
print $sql_1; //should print hey
I have looked high and low on how to do this. My first idea was eval but
I can't seem to get that to work in this instance. Any ideas?
On Friday 21 September 2001 01:45, Neil Silvester wrote:
> Another PHP problem has kept me up all night, scouring through my database
> books and trying everything I could think of. I am still new to the MySQL
> and PHP field, but never the lass I will not give up.
> $cat is a variable that is pas
On Fri, 21 Sep 2001 11:15, Neil Silvester wrote:
> Another PHP problem has kept me up all night, scouring through my
> database books and trying everything I could think of. I am still new
> to the MySQL and PHP field, but never the lass I will not give up.
> $cat is a variable that is passed to t
Another PHP problem has kept me up all night, scouring through my database
books and trying everything I could think of. I am still new to the MySQL
and PHP field, but never the lass I will not give up.
$cat is a variable that is passed to the query from the previous page. The
SELECT statement
I the Sears Christmas catologe is out, Im going to make a christmas wish
too.
I wish I could just do this
function test()
{
somefunc(func_get_args(), 'one more arg');
}
but I cant, I have todo this, ouch
function test()
{
$args = func_get_args();
eval("somefunc( '". implode("', '",
From: * R&zE: <[EMAIL PROTECTED]>
Date: Fri, Aug 31, 2001 at 04:36:36PM +0200
Message-ID: <[EMAIL PROTECTED]>
Subject: Re: [PHP] Variable Syntax Question
Btw... Why not just use an array?
and then:
foreach ($bob as $myValue) {
print ($myValue);
}
That's
From: Ninety-Nine Ways To Die <[EMAIL PROTECTED]>
Date: Fri, Aug 31, 2001 at 10:28:56AM -0400
Message-ID: <[EMAIL PROTECTED]>
Subject: [PHP] Variable Syntax Question
> I have a form that reads in a couple variables via:
>
>
>
>
>
>
> Now... I want to
I have a form that reads in a couple variables via:
Now... I want to read in those variables in something like the following:
for($i=1;$i<4;$i++) {
echo "$bob$i";
}
BUT that obviously doesn't work, it simple prints 1, so how to I make it echo the
value of the variable bob1?
-Hass
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi All,
i have come across a strange problem with variable variables. Basicly i'm
doing the following and its not working:
$section = 'data["SITE"][0]["NAME"][0]';
$pData = 'My Site.';
${sprintf('$%s', $section)}.=$pData;
but it is not working. But
why can i read PATH_INFO server variable with apache under windows server ?
with IIS 5 it's OK
how can i ?
-> Warning: Undefined variable: PATH_INFO in
e:\sitephp\php_edit\htdocs\var.php on line 3
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
Hi Mike!
Generally the only way to send information from a clientside javascript to
a serverside language (in this case PHP) is via a form submit or putting
that value into an HREF the user will click. For example:
Save your screen settings...
(please note: this is all rough
601 - 700 of 854 matches
Mail list logo