Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
105 views

This is a question related to getting Drupal CCK fields (just in case that happens to change anything). I have several Drupal CCK fields with similar names. They have the same name with a number at ...
Kerri's user avatar
  • 1,221
1 vote
6 answers
414 views

I have this code that generates an HTML table with php: <?php include("numbers2.php"); echo '<table border="1">'; echo '<tr>'; for ($i = 1; $i <= 9; $i++) { if($a1_pos_txt !== ...
Trufa's user avatar
  • 40.9k
0 votes
1 answer
94 views

Possible Duplicate: what's an actual use of variable variables? Is there any case in which PHP's variable variables make a solution clearer? E.g. this: $a = 'hello'; $$a = 'hello, world!'; ...
Joe D's user avatar
  • 2,973
0 votes
1 answer
168 views

I have some vars live: int foo1; int foo2; .. and I want to reach them from: for (int i = 1;i<=2;i++) { // howto get foo1 and foo2? } how to get them? EDIT, end what when it will be no int ...
gurehbgui's user avatar
  • 14.7k
4 votes
2 answers
5k views

I don't really know how to decribe this problem, so I'm sorry if the title is a bit unclear. I got an object with array fields. I got the name of these fields stored in a variable and I want to reach ...
Barthje's user avatar
  • 143
8 votes
7 answers
7k views

In PHP one can use variable variables... For example... class obj { } $fieldName = "Surname"; $object = new obj(); $object->Name = "John"; $object->$fieldName = "Doe"; echo "{$object->Name}...
Kornelije Petak's user avatar
3 votes
3 answers
473 views

Possible Duplicate: What's an actual use of variable variables? OK, this question may look a little bit point-whoreish, but I'd really like to know: when are variable variables useful? I haved ...
fabrik's user avatar
  • 14.4k
9 votes
7 answers
2k views

Variable variables seem pretty cool, but I can't think of a scenario where one would actually use them in a production environment. What would such a scenario be? How were they used?
user151841's user avatar
  • 18.1k
-1 votes
5 answers
347 views

There are 10 variables. say $var1, $var2, $var3, $var4,....$var10 and a $count variable. what I am looking for is if all variables are set then $count = 10+1 or if 9 variables only set then $count=9+1 ...
mathew's user avatar
  • 1,198
1 vote
1 answer
1k views

I have a piece of code here that does not work despite me using a $$ on it to treat the string as a variable: <? foreach (KOHANA::config('list.amenities_forms') as $k => $v) : ?> <div ...
yretuta's user avatar
  • 8,141
3 votes
5 answers
5k views

Is it possible to create a variable variable pointing to an array or to nested objects? The php docs specifically say you cannot point to SuperGlobals but its unclear (to me at least) if this applies ...
K-2052's user avatar
  • 197
6 votes
4 answers
553 views

Possible Duplicate: How to access javascript variable value by creating another variable via concatenation? In PHP I can have: $theVariable = "bigToe"; $bigToe = "is broken"; such that: echo "my ...
Aaron Luman's user avatar
566 votes
19 answers
282k views

I know that some other languages, such as PHP, support a concept of "variable variable names" - that is, the contents of a string can be used as part of a variable name. I heard that this is ...
user avatar
0 votes
3 answers
930 views

Hello! I'm not even sure if this is possible, but hopefully it is in Java. I know I've done it in PHP by using variable variables and accessing a variable dynamically, but I read this isn't possible ...
Chris Dale's user avatar
  • 2,222
5 votes
8 answers
3k views

I've been developing in PHP for a while now, and I still have not had a task where I've had to use variable variables. Can anyone give me examples where using them is a good idea ? Or were they ...
sjobe's user avatar
  • 2,837
6 votes
8 answers
8k views

Is something like the following possible in PHP? $blah = 'foo1'; class foo2 extends $blah { //... } class foo1 { //... } This gives an error. I want to dynamically set $blah so I can ...
Darryl Hein's user avatar

1 2 3
4