Interpret Order


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

Hello all,

I'm wondering if I have this:

Code: $switch = array(
'one' => $this->RenderOne()
,'two' => $this->RenderTwo()
);

Would php call the function $this->RenderOne() on assignment of $switch or does it call the function when $switch['one'] is used?

I'd like it if the function is called when $switch['one'] is used.

I know I can easily use a switch statement to get the desired behaviour. I was just curious as to how it got interpreted in this case.

Thanks in advance

No comments posted yet

Your Answer:

Login to answer
82 Like 21 Dislike
Previous forums Next forums
Other forums

Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there

How to show next and prev records
Hi all,

Sorry if this is simple, i'm very new to php, well, any programming language actually

Renaming array keys
The issue: renaming array keys inside a foreach loop.

I'm trying to build a pie chart image w

PHP4 to PHP5 Conversion
Hi Everyone,

I am working on a site that is built up on PHP4 and each page is being started f

upload form file types....
Hey all, I am learning PHP and I am writing a script from the W3C Schools tutorials for uploading fi

Can't seem to capture a variable in a chained select
I'm *this* close to having a chained select running but for some reason it doesn't seem to be pickin

passing an array of objects after submit
How do I do this? This is what I have tried and it is not working.

<form method="

Multiple includes losing variables
Hey all,

just starting out w php and ran into a problem pretty quickly. I'm
including seve

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

Output Full URL of Current Page
Let's say I am currently viewing a dynamic page:

http://www.mydomain.com/directory/index.php

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