$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

I am stumped
OK. Here is what I am trying to do. I have the conditions set, and if the conditions are met, I want

help countdown timers
hello every one,

I'd like to know how to insert many countdowns in the same page.
The dura

php code generators
All

Whilst enjoying learning a new language i have come accross a number of free code generat

Request.UrlReferrer
I need to make it so that a page can only be loaded when a button is clicked on a specific page. I d

Last Weeks sDate and eDate.
sDate - Start Date
eDate - End Date

I need to pull two dates for "Last Week" whi

PHP Surveys
I really would like some advice.

If you have a client come to you asking for a survey to be d

why aint this working?
i have this code:

Code: $num = 250;
$count = ($num - $rcount);

echo $rc

How to show a complete textarea ??
I enter Client Case Notes notes in a textarea field on a PHP form. The field is 5 rows deep and 70 c

rename the file
File.txt

Code: ***DOCUMENT***
..DN:
000044255
..CB:
..SN:
..PY:
2009
..E

tell csv import script to ignore blank rows?
Hi i have the below script but i get an error if a row is blank ie a return in the csv file at the e

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