$variable $variables type question


Posted on 16th Feb 2014 07:03 pm by admin

I need to be able to designate an array element dynamically, so I thought to use a variable variable, but it doesn't work:
Code: $test = array(1,2);
$num = "[0]";
echo $test{"$num"}; // expecting 1
Not working. Is this possible?

No comments posted yet

Your Answer:

Login to answer
322 Like 52 Dislike
Previous forums Next forums
Other forums

Using insert variable
need a way to inert variable data to mysql database

$acc = "212121212";
$nok =

Preg_match with an array
is there an away to use preg_match with an array?

i want to check a string with an array to s

Target costs on Process orders not calculating
Hi All,

We have released standard costs for all the materials. We have also done Goods r

Help With editting and deleting form
Hallo !!

So look at this image :

http://img194.imageshack.us/img194/8272/snapshot5f.pn

help with image text
Hi ...

see i need the text of the name and number to start in the center and always be in the

PHP referral database. I would like this form to email the referrer.
Okay, Hello I've been trolling for years. This the first time I've ever asked for php help. Normally

foreach iterator
Hi Guys
Does the foreach loop have an inbuilt iterator ?

List/Menu Box
On an edit page when you want something to select what a user has previously selected from the datab

Help with search.php
Hello All

I need the search engine on a site I am building at the moment to display the searc

User input in to variable
Hi all,

I'm sure this is very easy but I'm having another brain freeze!

At the end of

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash