On 10 August 2010 18:08, Andrew Ballard aball...@gmail.com wrote:
On Tue, Aug 10, 2010 at 12:23 PM, Richard Quadling rquadl...@gmail.com
wrote:
On 10 August 2010 16:49, Jim Lucas li...@cmsws.com wrote:
Richard Quadling wrote:
Hi.
Quick set of eyes needed to see what I've done wrong...
From: Richard Quadling
Quick set of eyes needed to see what I've done wrong...
The following is a reduced example ...
?php
$Set = array();
$Entry = 'Set[1]';
^^
Shouldn't that be $Set[1]?
$Value = 'Assigned';
$$Entry = $Value;
print_r($Set);
?
Bob McConnell
--
PHP
On 11 August 2010 13:58, Bob McConnell r...@cbord.com wrote:
From: Richard Quadling
Quick set of eyes needed to see what I've done wrong...
The following is a reduced example ...
?php
$Set = array();
$Entry = 'Set[1]';
^^
Shouldn't that be $Set[1]?
$Value = 'Assigned';
Hi.
Quick set of eyes needed to see what I've done wrong...
The following is a reduced example ...
?php
$Set = array();
$Entry = 'Set[1]';
$Value = 'Assigned';
$$Entry = $Value;
print_r($Set);
?
The output is an empty array.
Examining $GLOBALS, I end up with an entries ...
[Set] = Array
Richard Quadling wrote:
Hi.
Quick set of eyes needed to see what I've done wrong...
The following is a reduced example ...
?php
$Set = array();
$Entry = 'Set[1]';
$Value = 'Assigned';
$$Entry = $Value;
print_r($Set);
?
The output is an empty array.
Examining $GLOBALS, I end up with an
On 10 August 2010 16:49, Jim Lucas li...@cmsws.com wrote:
Richard Quadling wrote:
Hi.
Quick set of eyes needed to see what I've done wrong...
The following is a reduced example ...
?php
$Set = array();
$Entry = 'Set[1]';
$Value = 'Assigned';
$$Entry = $Value;
print_r($Set);
?
The
On Tue, Aug 10, 2010 at 12:23 PM, Richard Quadling rquadl...@gmail.com wrote:
On 10 August 2010 16:49, Jim Lucas li...@cmsws.com wrote:
Richard Quadling wrote:
Hi.
Quick set of eyes needed to see what I've done wrong...
The following is a reduced example ...
?php
$Set = array();
$Entry
$varname = \$_SERVER['REMOTE_ADDR'];
$varvalue = $$varname;
That's wrong. Offhand you'll end up printing a string. I tried this:
?php
$a = 365;
$b = 366;
$var = $_GET['var'];
echo $$var;
?
And it was fine.
--
Richard Heyes
HTML5 Graphing for FF, Chrome, Opera and
That's fine as a test, but you never want to get a variable name from a
URL in practice.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
Richard Heyes wrote:
$varname = \$_SERVER['REMOTE_ADDR'];
$varvalue = $$varname;
That's wrong. Offhand you'll
That's fine as a test, but you never want to get a variable name from a
URL in practice.
Of course you can, as long as it's sanitized and checked.
--
Richard Heyes
HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org
--
PHP General Mailing List (http://www.php.net/)
To
I mean that it is open for hacking if you pass a variable name through a
URL.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
daniel danon wrote:
What do you mean?
On Sun, Oct 12, 2008 at 5:40 PM, Micah Gersten [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
Hi, I was wondering,
By php.net manual, Please note that variable variables cannot be used with
PHP's Superglobal arrays within functions or class methods. Is there any
way to override this problem? Just the not nice eval(return $variable);?
and in simple words - is there any way to make the
On Wed, 2007-03-14 at 12:39 +0100, Jochem Maas wrote:
Richard Lynch wrote:
On Sat, March 10, 2007 6:28 am, Dave Goodchild wrote:
Hi guys, I have just read 'Programming PHP' (O'Reilly) and although I
think
it's a great book, I am confused about variable variables and
references -
not
On Sat, March 10, 2007 6:28 am, Dave Goodchild wrote:
Hi guys, I have just read 'Programming PHP' (O'Reilly) and although I
think
it's a great book, I am confused about variable variables and
references -
not the mechanics, just where you would use them.
The subject of variable variables is
2007/3/10, Dave Goodchild [EMAIL PROTECTED]:
Hi guys, I have just read 'Programming PHP' (O'Reilly) and although I
think
it's a great book, I am confused about variable variables and references -
not the mechanics, just where you would use them.
The subject of variable variables is explained
Hi guys, I have just read 'Programming PHP' (O'Reilly) and although I think
it's a great book, I am confused about variable variables and references -
not the mechanics, just where you would use them.
The subject of variable variables is explained but no examples are given as
to why and where
I must say, in all the years i am programming with PHP (about 5-6 years) i
NEVER used references.
So i don't find it useful, but well, if you want to give your variable
content more than one name, you can :)
I think you just need to start programming now, keeping in mind they are
available, but
: [PHP] Variable variables and references
Hi guys, I have just read 'Programming PHP' (O'Reilly) and although I think
it's a great book, I am confused about variable variables and references -
not the mechanics, just where you would use them.
The subject of variable variables is explained
sometimes you might (think you) need it.
Tijnema
- Original Message
From: Dave Goodchild [EMAIL PROTECTED]
To: PHP-General php-general@lists.php.net
Sent: Saturday, March 10, 2007 5:28:57 AM
Subject: [PHP] Variable variables and references
Hi guys, I have just read 'Programming PHP
]
To: PHP-General php-general@lists.php.net
Sent: Saturday, March 10, 2007 5:28:57 AM
Subject: [PHP] Variable variables and references
Hi guys, I have just read 'Programming PHP' (O'Reilly) and although I
think
it's a great book, I am confused about variable variables and
references
I was wondering if you could create variable variables for objects, please
see examples below, Im having problems getting it to work.
$data['fieldname'] = foo;
// without variable variables
$res = $db-query( SELECT foo FROM table );
while( $res-fetchInto( $db_data ) )
Hi List,
I'm using PHP5 with global variables off. I've got around 20 dynamically
generated forms with a total of 300 different variables sent thru these
forms. I'd like to use variable variables, but according to the manual this
is not possible.
Now comes my Questoin, how do I receive my
JanBro wrote:
Hi List,
I'm using PHP5 with global variables off. I've got around 20 dynamically
generated forms with a total of 300 different variables sent thru these
forms. I'd like to use variable variables, but according to the manual this
is not possible.
Now comes my Questoin, how do I
On Sat, 28 Aug 2004 11:43:13 +0200, JanBro [EMAIL PROTECTED] wrote:
Hi List,
I'm using PHP5 with global variables off. I've got around 20 dynamically
generated forms with a total of 300 different variables sent thru these
forms. I'd like to use variable variables, but according to the
Using Variable Variables works fine inside functions for global
defined variables if you declare them as global inside the function.
Suprinsingly, it does not seem to work with superglobals. Take the
following example:
// code
On Wed, 04 Aug 2004 23:15:03 +0200, ARico [EMAIL PROTECTED] wrote:
Using Variable Variables works fine inside functions for global
defined variables if you declare them as global inside the function.
Suprinsingly, it does not seem to work with superglobals. Take the
following example:
Justin Patrin wrote:
On Wed, 04 Aug 2004 23:15:03 +0200, ARico [EMAIL PROTECTED] wrote:
Using Variable Variables works fine inside functions for global
defined variables if you declare them as global inside the function.
Suprinsingly, it does not seem to work with superglobals. Take the
* Thus wrote ARico:
Using Variable Variables works fine inside functions for global
defined variables if you declare them as global inside the function.
Suprinsingly, it does not seem to work with superglobals. Take the
following example:
// code
Ok I am trying to create a variable from the value of a variable plus some
extra text tagged on the end of it.
So for example:
$test = '_over';
$$CONFIG['island'].$test = 'testing';
echo hawaii = $hawaii_over;
How can I do this? Im sure it's possible, but it just is not working for me
:(
Richard Baskett wrote:
Ok I am trying to create a variable from the value of a variable plus some
extra text tagged on the end of it.
So for example:
$test = '_over';
$$CONFIG['island'].$test = 'testing';
${$CONFIG['island'].$test} = 'testing';
echo hawaii = $hawaii_over;
Why not just use an
on 12/23/03 11:04, John W. Holmes at [EMAIL PROTECTED] wrote:
Richard Baskett wrote:
Ok I am trying to create a variable from the value of a variable plus some
extra text tagged on the end of it.
So for example:
$test = '_over';
$$CONFIG['island'].$test = 'testing';
-Original Message-
From: Douglas Douglas [mailto:[EMAIL PROTECTED]
Sent: 14 June 2003 00:57
Thanks for the explanation, but I think this is a
different case, isn't? I'm not trying to do this
${$_POST}, I'm trying to make this string $_POST.
Then why not just make it:
$var =
Hello everybody.
I have the following class method:
function HTTPValidator($method)
{
$this-data = ${'_'.$method};
$this-rules= array();
$this-required = array();
}
data, rules and required are arrays. The parameter
$method can have the values: GET or POST. I'm trying
to store
-Original Message-
From: Douglas Douglas
To: [EMAIL PROTECTED]
To get the superglobal array ($_GET or $_POST), I try
to build these strings '_'.$method. I'm sure this part
works, PHP builds the string _GET or _POST according
to the $method parameter.
I use ${'_'.$method} to get the
Thanks for the answer Mike.
Thanks for the explanation, but I think this is a
different case, isn't? I'm not trying to do this
${$_POST}, I'm trying to make this string $_POST.
And I have another question. Why does this code work?
?php
echo 'pre';
print_r($_POST);
echo '/prebrbr';
$method =
Hi,
Mike Smith wrote:
I am stumped on a project for a receiving system. I'm not sure how to handle
receiving more than one line item. I can UPDATE ... WHERE id=$detid when I
have 1 item, but how would I get the SQL to fire X times depending on the
number of line items I have AND UPDATE the
I am stumped on a project for a receiving system. I'm not sure how to handle
receiving more than one line item. I can UPDATE ... WHERE id=$detid when I
have 1 item, but how would I get the SQL to fire X times depending on the
number of line items I have AND UPDATE the appropriate record.
Solved it -- I *can* do what I wanted without variable variables... it was
human error.
Justin French
on 22/08/02 4:09 PM, Justin French ([EMAIL PROTECTED]) wrote:
Hi all,
Having trouble with the logic behind this.
I have a dynamic SKU, and a dynamic size_range array.
Examples:
Hi all,
Having trouble with the logic behind this.
I have a dynamic SKU, and a dynamic size_range array.
Examples:
$sku = '44044';
$size_range = array('S', 'M', 'L');
Which I use to build a pull down select box:
SELECT name=myselect
?
foreach($sizes as $k = $v)
{
echo OPTION
I have a question about the following
$LoadResult = mysql_query(SELECT * from Items where username='test' and
password='test');
$num_results =mysql_num_rows($LoadResult);
for ($i=0; $i $num_results;$i++) {
$myrow = mysql_fetch_array($LoadResult, MYSQL_ASSOC);
$ProductName =
use isset($$key);
ed
At 09:29 AM 5/30/2002 +1000, David Freeman wrote:
Hi All,
I've been trying to figure this out based on stuff on php.net but can't
seem to get a result I need.
I have an array:
$formarray = array (form1 = var1, form2 = var2);
And now I'm using that array to create a form
Hi All,
I've been trying to figure this out based on stuff on php.net but can't
seem to get a result I need.
I have an array:
$formarray = array (form1 = var1, form2 = var2);
And now I'm using that array to create a form (fairly abbreviated):
while (list($key, $val) = each($formarray))
{
I've got as far as working out that $$key will give me the
equivalent of $form1 but how do I then work out if $form1
has a value?
Never mind, ${$key} was what I was looking for - my test case set the
wrong variable and that's why it didn't seem to be working.
CYA, Dave
--
PHP
Never mind, ${$key} was what I was looking for - my test case set the
wrong variable and that's why it didn't seem to be working.
You may want to code with E_NOTICE errors showing. To
show all levels, use error_reporting:
error_reporting(E_ALL);
This will show you undefined variables,
You may want to code with E_NOTICE errors showing. To
show all levels, use error_reporting:
error_reporting(E_ALL);
Yeah, I already do that...
CYA, Dave
--
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 =
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 value
PROTECTED]]
Sent: Thursday, January 17, 2002 11:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] variable variables
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
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 $valueofsize =
$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$loopcounter) {
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 = 0; // set
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] =
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
-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 if
Okay, I read about this feature in the php manual. What I can't figure out
is why in the world would anybody want to use this feature? Not to start a
flame war, just would like an explanation of why this feature is useful.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
On Tue, Mar 13, 2001 at 06:36:10AM -0700, John Meyer wrote:
Okay, I read about this feature in the php manual. What I can't figure out
is why in the world would anybody want to use this feature? Not to start a
flame war, just would like an explanation of why this feature is useful.
I've
] Variable variables
On Tue, Mar 13, 2001 at 06:36:10AM -0700, John Meyer wrote:
Okay, I read about this feature in the php manual. What I can't figure
out
is why in the world would anybody want to use this feature? Not to start
a
flame war, just would like an explanation of why this feature
Meyer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 10:47 PM
To: Jason Stechschulte
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Variable variables
Okay, that makes a little sense, but isn't there some sort of collection
that will do the same thing (coming from vb).
-Original Message
58 matches
Mail list logo