$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
Did you know?Explore Trending and Topic pages for more stories like this.
Not working. Is this possible?
No comments posted yet

Your Answer:

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

check how many commas the variable containing the query has between [i]select[/i
Hi...

iv made an sql table that contains id number - name of sql query and an sql query.
T

email CODING Problem
Email coding problem.

I need to send a section of the info to $tf and the same as a Cc to $em

Question about ShowWindow()
Hello....

I'm struggling with sumpin, and I hope y'all can help.

I've got a CFormView

Using real time in php
I'm very average at PHP and im looking to introduce time to something on my site.
Its a sports si

How to extract/download content from HTTPS page?
Hello to all the Members of this forum, Im Shoiab, A novice programmer in php.. for my first job I h

PHP Cannot redeclare class
I have 6 files, and two of them do not seem to want to play well. I keep getting a "Cannot rede

This is driving me nuts!
This insert query looks to be alright, however I get this error:

QuoteYou have an error in yo

how can i make a .gif images for my site
Dear Friends ,

Pls solve my problem , I am starting making new site but i dont know how can i

strptime() equivalent for php4 ?!
Greetings!

this is my first post, thank you in advance for your replies.

Well, the ti

From Header Showing 'Unkown' In Hotmail? Why?
Code: $to = $row_GetID['email_addr'].',sales@mywebaddress.co.uk';
$subject = 'Thank you for you

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