> $var = constant('DESKTOP_URL_' . $_SESSION['lang']);
Very nice, thank you.
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 10/12/11 11:51, "Marc Guay" wrote:
>Let's say that I have 2 constants
>
>DEFINE('DESKTOP_URL_en', "http://www.website.com/index.php?page=home";);
>DEFINE('DESKTOP_URL_fr',
>"http://www.website.com/index.php?page=accueil";);
>
>and I would like to populate the value of an href with them depend
Hi folks,
Let's say that I have 2 constants
DEFINE('DESKTOP_URL_en', "http://www.website.com/index.php?page=home";);
DEFINE('DESKTOP_URL_fr', "http://www.website.com/index.php?page=accueil";);
and I would like to populate the value of an href with them depending
on the us
There's a number of things you can do with variable variables... they're
quite powerful, I like 'em a lot. :)
Anyway, you can do
This would output
stuff
I think that's what you were asking... You've got to use the { and } around
the variables you're using to make teh variable variable.
turns out my subject was right on anyone interested check this page
out.
http://www.phpbuilder.com/manual/language.variables.variable.php
""Brian Weisenthal"" <[EMAIL PROTECTED]> wrote in message
9h02nm$n7c$[EMAIL PROTECTED]">news:9h02nm$n7c$[EMAIL PROTECTED]...
> let say i wanted to see
let say i wanted to see if a variable existed by the name of $myvar2 . how
can i make the '2' come from a variable. so i want to say something like
$myvar$othervar .(but obviously that wont work) anyone have a clue? i tried
using eval but i couldn't get it right
--
PHP General Mailing L
http://www.php.net/manual/en/language.variables.variable.php
-Original Message-
From: Brandon Orther [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 07, 2001 4:53 PM
To: PHP User Group
Subject: [PHP] Variable Variable
Hello,
I can't find Variable Variable in the php manual. If so
Hello,
I can't find Variable Variable in the php manual. If someone has a link to
the section in the PHP manual about this please send me a link.
Thank you,
Brandon Orther
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-m
are you thinking of what this snippet does:
$menu = 'menu2';
$i = 2;
echo ${$menu}[$i];
- Original Message -
From: "Brandon Orther" <[EMAIL PROTECTED]>
To: "PHP User Group" <[EMAIL PROTECTED]>
Sent: 2001. május 7. 22:16
Subject: [PHP] Variabl
Hello,
I am trying to use variable variable. with arrays. this may be hard to
understand so here is an example:
$menu1[0] = "1";
$menu1[1] = "2";
$menu1[2] = "3";
$menu2[0] = "1";
$menu2[1] = "2";
$menu2[2] = "3";
$menu3[0] = "1";
$menu3[1] = "2";
$menu3[2] = "3";
does anyone know t
> The braces aren't required in this case.
Yup, your right. I stand corrected.
I had forgotten that multiple $s are fine, and that I simply don't use them
because I have trouble reading them.
The joys of learning ;\
--
Plutarck
Should be working on something...
...but forgot what it was.
""
> "Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote:
> > > 1. If $id is a number I believe PHP will choke b/c I don't believe
> numbers
> > > can be used as variable names.
> >
> > Well, generally that is true. If you try to assign a value directly to a
> > variable that is a number such as:
> >
> > $1
"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote:
> > 1. If $id is a number I believe PHP will choke b/c I don't believe
numbers
> > can be used as variable names.
>
> Well, generally that is true. If you try to assign a value directly to a
> variable that is a number such as:
>
> $1 = "Hello World";
> 1. If $id is a number I believe PHP will choke b/c I don't believe numbers
> can be used as variable names.
Well, generally that is true. If you try to assign a value directly to a
variable that is a number such as:
$1 = "Hello World";
Then it won't work. However, due to a somewhat quirky
"Plutarck" <[EMAIL PROTECTED]> wrote:
> Your problem has little to do with the things mentioned.
>
> First of all, you are refering to a variable variable incorrectly.
Actually, he's not.
>You must
> use brackets, like this:
>
> ${$id}
The braces aren't required in this case. Of the four examp
Your problem has little to do with the things mentioned.
First of all, you are refering to a variable variable incorrectly. You must
use brackets, like this:
${$id}
If ID has the value "Blue", then the above is the same as:
$Blue
So in your examble if you had the checkbox with the value "on",
than reaching the goal you set for
> yourself"
> - Original Message -
> From: Chris Fry <[EMAIL PROTECTED]>
> To: Jacky <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Wednesday, April 18, 2001 2:59 AM
> Subject: Re: [PHP] Variable varia
-
From: Chris Fry <[EMAIL PROTECTED]>
To: Jacky <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, April 18, 2001 2:59 AM
Subject: Re: [PHP] Variable variable
> Sorry - thought you only had one! - it's late.
>
> To Name the checkboxes you need:
> whil
;
> - Original Message -
> From: Chris Fry <[EMAIL PROTECTED]>
> To: Jacky <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Wednesday, April 18, 2001 2:31 AM
> Subject: Re: [PHP] Variable variable
>
> > Jacky,
> >
> > You do not need
OTECTED]>
Sent: Wednesday, April 18, 2001 2:31 AM
Subject: Re: [PHP] Variable variable
> Jacky,
>
> You do not need the value. The variable $id will either exist (if the user
checked it) or not (if the user did not check it).
>
> Hope this helps.
>
> Chris
>
> Jacky wrote:
more rewarding than reaching the goal you set for
yourself"
- Original Message -
From: Ulf Wendel <[EMAIL PROTECTED]>
To: Jacky <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, April 18, 2001 2:20 AM
Subject: Re: [PHP] Variable variable
>
>
> Ja
Jacky,
You do not need the value. The variable $id will either exist (if the user checked it)
or not (if the user did not check it).
Hope this helps.
Chris
Jacky wrote:
> Hi all
> I have a form with check box and name of those checkboxes is usuing variable lke
>this,
>
>
>
>
> and when I
Jacky schrieb:
>
>
>
> and when I submit the form to page foo.php4, at that page, I use Variable variable
>to call the value of the check box to see if it checked like this
>
> $quey = "select id from table";
> $result = .. ( assumeing it is done and i got value for $id for all records
Hi all
I have a form with check box and name of those checkboxes is usuing variable lke this,
and when I submit the form to page foo.php4, at that page, I use Variable variable to
call the value of the check box to see if it checked like this
$quey = "select id from table";
$result = ..
24 matches
Mail list logo