$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

Using Windows message as a Handle
Hi,

I am writing one of my first multithreaded programs.

In one of the thread,

Need to write a cookie with a url var
Not sure if its possible, but I need to write a cookie with a url.

So this would write 2232 a

Keeping data in form
How can I keep whatever I write in the form?

Check before inserting in DB ???
This is my code
---------------
if ( $_POST ['Submit'])
{{
$username = $_POST ['usernm

GET vs SUBMIT Button to show sections on one index.php page?
Just curious if one of these ways is better (i.e. more efficient) than the other.

I have a

BB_Code error
I'm having a problem with a custom built function and keep getting this error:


Warning: M

Customizing message/behavior
Hi,I'm using the ASP.NET membership/authorization controls in my application. Some parts of my appli

Adding to an Int row in db
Hi, i have a database which houses all of the users of my site. One of the columns is for points whi

mr8m - reverse document
Friends,

I'm trying to reverse a document held by MIRO, but it reports the message balan

Download Image from URL and Upload it
Ok, I have been googling for the last 1/2 hour trying to figure this out, Most likely I'm just not s

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