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

82 Like 21 Dislike
Previous php-forum Next php-forum
Other php-forum

Creating a function
Basically i wanna put all this code in a seperate file

Code: <?php

Help with email validation please...
Hi,
Please could you help.
I have a register.php login page where users register, the detail

Basic Forum Tutorial
Hi, I'm new to PHP. I want to build a basic forum for my site using PHP and MySQL. I've searched t

Date/Time and Checkbox
Hi Everyone,

I am trying to figure out how to insert the current date and tim

bit of help needed
Im about to sort out my registration page for my website by customising a "registration" s

Checking if variable is 0 as opposed to NULL/Empty...
I'm trying to write some code that will retrieve a user's access level from my database and if it do

php mail form text wont appear / javascript included
Guys/gals...

I am running into a problem whereby I have a great piece of javascript code that

Help =( !! Upload Pics [PHP script]
Hello
I need help with a php script [MULTIPLE UPLOAD IMAGES] , where I want to add a feature (wat

Embedding flash object in Else statement
This is my first major project in PHP and I'm having some trouble embedding a flash object in an Els

On page view, minus credit
Hello all, please, I need a little help with this script. I am charging one credit (credits can be p

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