$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

Doubles are giving me problems
Ok so, first of all i made a double = 0.05, but when running the debugger it shows up as 0.04999. I

Target costs on Process orders not calculating
Hi All,

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

how do i make new line after *
First check this page here. and you see my report. Im pulling form a mysql db. I want to beable to m

Checking if a process is running (problems including psapi.dll i think...)
Ok, so all I'm trying to do is check if a program is running...

I've found out that I nee

SQL query not working well
Hi,
I made a small table with 5 rows and want to make them an sql consult using rownum

Table colours fail when extra row added
Hey Gurus,

I got a weird problem with formating the colour of a table made in php. Everything

I need help on this PHP code
Hi everybody, I made some kind of mistake while editing the code below. As you see, at the 3 row my

Printer configuration
Hi All,
Suppose one of the user deleted the printer settings unfortunatly ,then what is the pro

Coefficient of a Restitution Hints
Hello. I was wondering if anyone can give me hints on how to write this program...

The coeffi

Recode Abap Dynpro into Web Dynpro
Hi All,
A client has asked us to look at rearchitecting a custom transaction that was developed

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