Re: [PHP] $$var

2011-03-06 Thread NetEmp
As per my experience so far, there is no such depth limit existing. The only limit is imposed by the system resources (like script execution time etc.) but not by PHP. Cheers NetEmp On Sun, Mar 6, 2011 at 8:42 PM, shiplu wrote: > Just being curious, I have a question. > How many times PHP inter

Re: [PHP] $$var

2011-03-06 Thread Mujtaba Arshad
If $a = 'foo' and $$a = nothing (i.e. no value assigned to $foo) you will get an error if you tried to use this to do something else. On Sun, Mar 6, 2011 at 3:21 PM, tedd wrote: > At 6:42 PM +0530 3/6/11, Ashim Kapoor wrote: > >> Dear All, >> >> I was reading the php manual for session_register,

Re: [PHP] $$var

2011-03-06 Thread tedd
At 6:42 PM +0530 3/6/11, Ashim Kapoor wrote: Dear All, I was reading the php manual for session_register, and I found the following line there : - $_SESSION[$var] = $$var; Why do I need $$ there ? Can someone explain? Thank you, Ashim Ashim: You don't need to user session_register(). Che

Re: [PHP] $$var

2011-03-06 Thread sexyprout
∞ 2011/3/6 shiplu > Just being curious, I have a question. > How many times PHP interpreter will replace this variables? I mean how deep > it will be? > > If I use variable variables like > > $$a > how long i

Re: [PHP] $$var

2011-03-06 Thread shiplu
Just being curious, I have a question. How many times PHP interpreter will replace this variables? I mean how deep it will be? If I use variable variables like $$a how long it will be evaluated? -- Shiplu Mok

Re: [PHP] $$var

2011-03-06 Thread Ashim Kapoor
> Hi Ashim, > > These are called Variable Variables. Ideally they should be avoided, > as they introduce unnecessary legibility issues. > > This is what it does in a nutshell, it's actually quite simple: > > $foo = 'bar'; > $bar = 'foobar'; > echo $$foo;//This prints foobar > > What it does is,

Re: [PHP] $$var

2011-03-06 Thread Russell Dias
Hi Ashim, These are called Variable Variables. Ideally they should be avoided, as they introduce unnecessary legibility issues. This is what it does in a nutshell, it's actually quite simple: $foo = 'bar'; $bar = 'foobar'; echo $$foo;//This prints foobar What it does is, take the value of $

Re: [PHP] Var within a var

2006-04-09 Thread Kevin Waterson
This one time, at band camp, bob pilly <[EMAIL PROTECTED]> wrote: > Hi All > > Im trying to store a document template in mysql that has php var names > within it and then find it in the datebase and print it out with the var > names replaced with the var values. eval() Kevin -- "Democracy

Re: [PHP] var references question

2004-09-19 Thread Curt Zirzow
* Thus wrote Brandon Goodin: > Greetings, > > > In the following example when I run the myscript.php I pass the $myarr into > the addVal function of the MyClass class. The var_dump in the addVal > function appropriately displays all of the elements of the array a,b,c and > d. However, the var_du

Re: [PHP] var references

2004-02-06 Thread Arthur Pelkey
Thanks!, my syntax was a bit off, havn't had much sleep, but it kept slipping by me ;) Chris W. Parker wrote: Arthur Pelkey on Friday, February 06, 2004 9:46 AM said: $blat = $tue_5a; [snip] while($row = mysql_fetch_array($result)) { switch($blat) {

RE: [PHP] var references

2004-02-06 Thread Chris W. Parker
Arthur Pelkey on Friday, February 06, 2004 9:46 AM said: > $blat = $tue_5a; [snip] > while($row = mysql_fetch_array($result)) { > switch($blat) { > case tue_5a: > $min_1 = $row[29]; > break; > } [snip] > Why can I not

RE: [PHP] /VAR is driving me crazy - SOLVED

2004-01-16 Thread Boaz Yahav
y 16, 2004 5:07 PM To: Boaz Yahav Cc: [EMAIL PROTECTED] Subject: Re: [PHP] /VAR is driving me crazy Boaz Yahav wrote: > Hi > > Does anyone have an idea what is so special about the string "/VAR" ? > If i create a form that submits to a php file and in the form i put >

Re: [PHP] /VAR is driving me crazy

2004-01-16 Thread John W. Holmes
Boaz Yahav wrote: Hi Does anyone have an idea what is so special about the string "/VAR" ? If i create a form that submits to a php file and in the form i put the string /VAR anywhere in the text or just /VAR I get an 404 error from apache on an existing file. If i take the same form and remove th

Re: [PHP] var static

2003-08-28 Thread Jordan S. Jones
If I were you, I would use the following: if (!is_a ($miInstancia, 'db')) $miInstancia=new db(); That way you can ensure that the variable has been instantiated and is an instance of the db class.. But it may not really matter.. Jordan S. Jones Alvaro Martinez wrote: I've found the solution m

Re: [PHP] var static

2003-08-28 Thread Robert Cummings
Globals!? YUCK :) A better solution IMHO that maintains encapsulation, is to use a static var in a function: function &getClassVar( $name ) { return getAndSetClassVar( $name, false ); } function &setClassVar( $name, $value ) { return getAndSetClassVar( $name, true, $value ); } function &

Re: [PHP] var static

2003-08-28 Thread Alvaro Martinez
I've found the solution myself. The db class is the next: class db{ function db (){ // funcion que se conecta con la BBDD $result = @mysql_pconnect("inforalv", "discoteca", "password"); if (!$result) return false; if ([EMAIL PROTECTED]("discoteca")) return false; } function &getInstancia(){ stat

Re: [PHP] var static

2003-08-28 Thread Tom Rogers
Hi, Friday, August 29, 2003, 3:01:45 AM, you wrote: AM> I want to obtain only one instance of one class. In other to do that, I call AM> to a static method, that creates the instance(if it doesnt exit) or returns AM> the reference of the instance. AM> The call to the static method is the next: AM

RE: [PHP] var static

2003-08-28 Thread Dynamical.biz
Although PHP supports static variables in functions (see here), it has no support for static variables in classes. http://www.php.net/manual/en/language.variables.scope.php (espero que te sirva) saludos aniceto lópez :: DYNAMICAL.BIZ web development & host services Barcelona - Spain -Me

RE: [PHP] Var question

2002-10-24 Thread Clint Tredway
Thanks guys.. I am moving away from ColdFusion to PHP and so I still forget about the isset() function. -Original Message- From: 1LT John W. Holmes [mailto:holmes072000@;charter.net] Sent: Thursday, October 24, 2002 8:53 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Var

Re: [PHP] Var question

2002-10-24 Thread Maxim Maletsky
is go a variable that is passed via post? I guess yes but you get this error without submitting yet. There are three solutions: 1. Change your error reporting level to 55: error_reporting(55). This will stop warning your undefined variables. 2. Prefix the variable with an at-mark: @$_POST['go

Re: [PHP] Var question

2002-10-24 Thread 1LT John W. Holmes
You can just check for if(isset($_POST['go'])) You don't really care what the value is since it's just a button. ---John Holmes... - Original Message - From: "Clint Tredway" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 24, 2002 9:33 AM Subject: [PHP] Var questio

Re: [PHP] $var , '$var'

2001-08-18 Thread ReDucTor
nothing, execpt, think there would be about 0.1 time difference... :D I use $var = $blah."bleh'.$foo because syntax highlighting looks better :D - James "ReDucTor" Mitchelll - Original Message - From: "nafiseh saberi" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, August 1

Re: [PHP] $var , '$var'

2001-08-18 Thread Chris Lambert
In what context? print $var; // prints the value of $var print "$var"; // prints the value of $var print '$var'; // prints $var /* Chris Lambert, CTO - [EMAIL PROTECTED] WhiteCrown Networks - More Than White Hats Web Application Security - www.whitecrown.net */ - Original Message - Fro

Re: [PHP] var question

2001-04-16 Thread Steve Edberg
You can also look at environment variable $QUERY_STRING. For example, if ($HTTP_SERVER_VARS['QUERY_STRING'] == 'login') { ...do log in procedure If register_globals is on, all you need is if ($QUERY_STRING == 'login') If you might be passing other parameters

Re: [PHP] var question

2001-04-16 Thread Plutarck
Note: Yes, I meant string instrument. Any references to YoYo Ma will be dealt with swiftly and severly. -- Plutarck Should be working on something... ...but forgot what it was. ""Plutarck"" <[EMAIL PROTECTED]> wrote in message 9bfp5e$169$[EMAIL PROTECTED]">news:9bfp5e$169$[EMAIL PROTECTED]...

Re: [PHP] var question

2001-04-16 Thread Aemuli
ple think I just do it to annoy them. I just like the way "viola" sounds :) Plutarck Should be working on something... ...but forgot what it was. - Original Message - From: "Brian Clark" <[EMAIL PROTECTED]> To: "Plutarck" <[EMAIL PROTECTED]> Sent:

Re: [PHP] var question

2001-04-16 Thread Plutarck
Add an "=" on the end of your url. Viola. -- Plutarck Should be working on something... ...but forgot what it was. ""Jeroen Geusebroek"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi Guys, > > I have a question about the way PHP handles var/strings. > >

RE: [PHP] VAR and variables

2001-01-29 Thread Steve Edberg
At 10:50 AM + 1/29/01, Tim Ward wrote: > > -Original Message- >> From: Steve Edberg [mailto:[EMAIL PROTECTED]] >> Sent: 25 January 2001 22:02 >> To: Matt; [EMAIL PROTECTED] >> Subject: Re: [PHP] VAR and variables >> >> >> At

Re: [PHP] VAR and variables

2001-01-25 Thread Steve Edberg
At 3:00 PM -0600 1/25/01, Matt wrote: >I have a question that may seem kind of silly, but I'm curious... > >When using PHP why would one use "var" to define a variable as >opposed to just regularly creating it? Because that's the way it is ;). The var is part of the syntax of a class definitio